conformance.exp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Functional and regression tests in C++ for libstdc++.
  2. # Copyright (C) 2001-2022 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; see the file COPYING3. If not see
  16. # <http://www.gnu.org/licenses/>.
  17. # libstdc++-v3 testsuite that uses the 'dg.exp' driver.
  18. # Initialization.
  19. dg-init
  20. # Build the support objects.
  21. v3-build_support
  22. set tests [list]
  23. # If there is a "testsuite_files" file, use it.
  24. #
  25. # This is a workaround for problems reported with using:
  26. #
  27. # runtest normal.exp="`cat testsuite_files`"
  28. #
  29. # See:
  30. # http://gcc.gnu.org/ml/libstdc++/2005-03/msg00278.html
  31. # for discussion of the problem.
  32. #
  33. # If that worked consistently, we could modify "make check" to
  34. # pass that option, and then remove this code.
  35. if {[info exists blddir]} {
  36. set tests_file "${blddir}/testsuite/testsuite_files"
  37. }
  38. if {[info exists tests_file] && [file exists $tests_file]} {
  39. set f [open $tests_file]
  40. while { ! [eof $f] } {
  41. set t [gets $f]
  42. if { [string length "$t"] != 0 } {
  43. lappend tests ${srcdir}/${t}
  44. }
  45. }
  46. close $f
  47. } else {
  48. # Find directories that might have tests.
  49. # This list should be consistent with scripts/create_testsuite_files
  50. set subdirs [glob "$srcdir/\[0-9\]\[0-9\]*"]
  51. lappend subdirs "$srcdir/std"
  52. lappend subdirs "$srcdir/abi"
  53. lappend subdirs "$srcdir/backward"
  54. lappend subdirs "$srcdir/ext"
  55. lappend subdirs "$srcdir/performance"
  56. lappend subdirs "$srcdir/tr1"
  57. lappend subdirs "$srcdir/tr2"
  58. lappend subdirs "$srcdir/decimal"
  59. lappend subdirs "$srcdir/experimental"
  60. lappend subdirs "$srcdir/special_functions"
  61. verbose "subdirs are $subdirs"
  62. # Find all the tests.
  63. foreach s $subdirs {
  64. set subdir_tests [find $s *.cc]
  65. set subdir_tests_c [find $s *.c]
  66. foreach e $subdir_tests_c {
  67. lappend subdir_tests $e
  68. }
  69. # Filter out tests that should not be run.
  70. foreach t $subdir_tests {
  71. # The DejaGNU "find" procedure sometimes returns a list
  72. # containing an empty string, when it should really return
  73. # an empty list.
  74. if { $t == "" } {
  75. continue
  76. }
  77. # Filter out:
  78. # 0. utilities, other parts of the testing infrastructure.
  79. # 1. interactive tests.
  80. # 2. performance tests.
  81. # 3. wchar_t tests, if not supported.
  82. # 4. thread tests, if not supported.
  83. # 5. *_filebuf, if file I/O is not supported.
  84. # 6. simd tests.
  85. if { [string first _xin $t] == -1
  86. && [string first performance $t] == -1
  87. && (${v3-wchar_t} || [string first wchar_t $t] == -1)
  88. && (${v3-threads} || [string first thread $t] == -1)
  89. && ([string first "_filebuf" $t] == -1
  90. || [check_v3_target_fileio])
  91. && [string first "/experimental/simd/" $t] == -1 } {
  92. lappend tests $t
  93. }
  94. }
  95. }
  96. }
  97. set tests [lsort $tests]
  98. # Main loop.
  99. global DEFAULT_CXXFLAGS
  100. global PCH_CXXFLAGS
  101. dg-runtest $tests "" "$DEFAULT_CXXFLAGS $PCH_CXXFLAGS"
  102. # Finally run simd tests with extra SIMD-relevant flags
  103. global DEFAULT_VECTCFLAGS
  104. global EFFECTIVE_TARGETS
  105. set DEFAULT_VECTCFLAGS ""
  106. set EFFECTIVE_TARGETS ""
  107. if [check_vect_support_and_set_flags] {
  108. lappend DEFAULT_VECTCFLAGS "-O2"
  109. lappend DEFAULT_VECTCFLAGS "-Wno-psabi"
  110. et-dg-runtest dg-runtest [lsort \
  111. [glob -nocomplain $srcdir/experimental/simd/*.cc]] \
  112. "$DEFAULT_VECTCFLAGS" "$DEFAULT_CXXFLAGS $PCH_CXXFLAGS"
  113. }
  114. # All done.
  115. dg-finish