mt.exp 2.1 KB

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