]> git.ipfire.org Git - thirdparty/gcc.git/blob - libitm/testsuite/libitm.c++/c++.exp
Merge from transactional-memory branch.
[thirdparty/gcc.git] / libitm / testsuite / libitm.c++ / c++.exp
1 # This program is free software; you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation; either version 2 of the License, or
4 # (at your option) any later version.
5 #
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
10 #
11 # You should have received a copy of the GNU General Public License
12 # along with this program; if not, write to the Free Software
13 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14
15 load_lib libitm-dg.exp
16
17 global shlib_ext
18
19 set shlib_ext [get_shlib_extension]
20 set lang_link_flags "-lstdc++"
21 set lang_test_file_found 0
22 set lang_library_path "../libstdc++-v3/src/.libs"
23
24 # Initialize dg.
25 dg-init
26
27 set blddir [lookfor_file [get_multilibs] libgomp]
28
29
30 if { $blddir != "" } {
31 # Look for a static libstdc++ first.
32 if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
33 set lang_test_file "${lang_library_path}/libstdc++.a"
34 set lang_test_file_found 1
35 # We may have a shared only build, so look for a shared libstdc++.
36 } elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
37 set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}"
38 set lang_test_file_found 1
39 } else {
40 puts "No libstdc++ library found, will not execute c++ tests"
41 }
42 } elseif { [info exists GXX_UNDER_TEST] } {
43 set lang_test_file_found 1
44 # Needs to exist for libgomp.exp.
45 set lang_test_file ""
46 } else {
47 puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
48 }
49
50 if { $lang_test_file_found } {
51 # Gather a list of all tests.
52 set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
53
54 if { $blddir != "" } {
55 set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
56 } else {
57 set ld_library_path "$always_ld_library_path"
58 }
59 append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
60 set_ld_library_path_env_vars
61
62 set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags"
63 if { [file exists $flags_file] } {
64 set libstdcxx_includes [exec sh $flags_file --build-includes]
65 } else {
66 set libstdcxx_includes ""
67 }
68
69 # Main loop.
70 dg-runtest $tests "" $libstdcxx_includes
71 }
72
73 # All done.
74 dg-finish