Debian Codegraph @

libvtv/testsuite/libvtv.mempool.cc/mempool.exp

raw
1 load_lib libvtv-dg.exp
2 load_gcc_lib gcc-dg.exp
3
4 global VTV_FLAGS
5 set VTV_FLAGS [list {-O0} {-O2}]
6
7 libvtv_init c++
8
9 set shlib_ext [get_shlib_extension]
10 set lang_link_flags "-shared-libgcc -lstdc++"
11 set lang_test_file_found 0
12 set lang_library_path "../libstdc++-v3/src/.libs"
13
14 dg-init
15
16 set blddir [lookfor_file [get_multilibs] libvtv]
17
18 # Find the correct libstdc++ library to use.
19
20 if { $blddir != "" } {
21 # Look for a static libstdc++ first.
22 if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
23 set lang_test_file "${lang_library_path}/libstdc++.a"
24 set lang_test_file_found 1
25 # We may have a shared only build, so look for a shared libstdc++.
26 } elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
27 set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}"
28 set lang_test_file_found 1
29 } else {
30 puts "looking for ${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"
31 puts "No libstdc++ library found, will not execute c++ tests"
32 }
33 } elseif { [info exists GXX_UNDER_TEST] } {
34 set lang_test_file_found 1
35 # Needs to exist for libvtv.exp.
36 set lang_test_file ""
37 } else {
38 puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
39 }
40
41
42 global srcdir
43
44 if { $lang_test_file_found } {
45 # Set the path for finding libstdc++.
46 if { $blddir != "" } {
47 set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
48 } else {
49 set ld_library_path "$always_ld_library_path"
50 }
51 append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
52 set_ld_library_path_env_vars
53
54 # Make sure we can find the libstdc++ header files.
55 set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags"
56 if { [file exists $flags_file] } {
57 set libstdcxx_includes [exec sh $flags_file --build-includes]
58 } else {
59 set libstdcxx_includes ""
60 }
61
62 # Run the tests with -fvtable-verify=std
63 foreach flags $VTV_FLAGS {
64 foreach srcfile [lsort [glob -nocomplain ${srcdir}/libvtv.mempool.cc/*.cc]] {
65 dg-runtest $srcfile "$flags -fvtable-verify=std" $libstdcxx_includes
66 }
67 }
68 }