diff options
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r-- | gcc/testsuite/lib/g++-dg.exp | 130 | ||||
-rw-r--r-- | gcc/testsuite/lib/gm2-dg.exp | 37 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 13 |
3 files changed, 110 insertions, 70 deletions
diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp index 26bda65..042a917 100644 --- a/gcc/testsuite/lib/g++-dg.exp +++ b/gcc/testsuite/lib/g++-dg.exp @@ -27,6 +27,79 @@ proc g++-dg-prune { system text } { return [gcc-dg-prune $system $text] } +# Return a list of -std flags to use for TEST. +proc g++-std-flags { test } { + # If the testcase specifies a standard, use that one. + # If not, run it under several standards, allowing GNU extensions + # if there's a dg-options line. + if ![search_for $test "-std=*++"] { + if [search_for $test "dg-options"] { + set std_prefix "-std=gnu++" + } else { + set std_prefix "-std=c++" + } + + set low 0 + # Some directories expect certain minimums. + if { [string match "*/coroutines/*" $test] } { set low 20 } + if { [string match "*/modules/*" $test] } { set low 17 } + + # See g++.exp for the initial value of this list. + global gpp_std_list + if { [llength $gpp_std_list] > 0 } { + set std_list {} + foreach ver $gpp_std_list { + set cmpver $ver + if { $ver == 98 } { set cmpver 03 } + if { $ver ni $std_list + && $cmpver >= $low } { + lappend std_list $ver + } + } + } else { + # If the test mentions specific C++ versions, test those. + set lines [get_matching_lines $test {\{ dg* c++[0-9][0-9]}] + set std_list {} + foreach line $lines { + regexp {c\+\+([0-9][0-9])} $line -> ver + lappend std_list $ver + + if { $ver == 98 } { + # Leave low alone. + } elseif { [regexp {dg-do|dg-require-effective-target} $line] } { + set low $ver + } + } + #verbose "low: $low" 1 + + set std_list [lsort -unique $std_list] + + # If fewer than 3 specific versions are mentioned, add more. + # The order of this list is significant: first $cxx_default, + # then the oldest and newest, then others in rough order of + # importance based on test coverage and usage. + foreach ver { 17 98 26 11 20 14 23 } { + set cmpver $ver + if { $ver == 98 } { set cmpver 03 } + if { [llength $std_list] < 3 + && $ver ni $std_list + && $cmpver >= $low } { + lappend std_list $ver + } + } + verbose "std_list: $std_list" 1 + } + set option_list { } + foreach x $std_list { + if { $x eq "impcx" } then { set x "26 -fimplicit-constexpr" } + lappend option_list "${std_prefix}$x" + } + } else { + set option_list { "" } + } + return $option_list +} + # Modified dg-runtest that runs tests in multiple standard modes, # unless they specifically specify one standard. proc g++-dg-runtest { testcases flags default-extra-flags } { @@ -38,62 +111,7 @@ proc g++-dg-runtest { testcases flags default-extra-flags } { continue } - # If the testcase specifies a standard, use that one. - # If not, run it under several standards, allowing GNU extensions - # if there's a dg-options line. - if ![search_for $test "-std=*++"] { - if [search_for $test "dg-options"] { - set std_prefix "-std=gnu++" - } else { - set std_prefix "-std=c++" - } - - # See g++.exp for the initial value of this list. - global gpp_std_list - if { [llength $gpp_std_list] > 0 } { - set std_list $gpp_std_list - } else { - # If the test mentions specific C++ versions, test those. - set lines [get_matching_lines $test {\{ dg* c++[0-9][0-9]}] - set std_list {} - set low 0 - foreach line $lines { - regexp {c\+\+([0-9][0-9])} $line -> ver - lappend std_list $ver - - if { $ver == 98 } { - # Leave low alone. - } elseif { [regexp {dg-do|dg-require-effective-target} $line] } { - set low $ver - } - } - #verbose "low: $low" 1 - - set std_list [lsort -unique $std_list] - - # If fewer than 3 specific versions are mentioned, add more. - # The order of this list is significant: first $cxx_default, - # then the oldest and newest, then others in rough order of - # importance based on test coverage and usage. - foreach ver { 17 98 26 11 20 14 23 } { - set cmpver $ver - if { $ver == 98 } { set cmpver 03 } - if { [llength $std_list] < 3 - && $ver ni $std_list - && $cmpver > $low } { - lappend std_list $ver - } - } - verbose "std_list: $std_list" 1 - } - set option_list { } - foreach x $std_list { - if { $x eq "impcx" } then { set x "26 -fimplicit-constexpr" } - lappend option_list "${std_prefix}$x" - } - } else { - set option_list { "" } - } + set option_list [g++-std-flags $test] set nshort [file tail [file dirname $test]]/[file tail $test] diff --git a/gcc/testsuite/lib/gm2-dg.exp b/gcc/testsuite/lib/gm2-dg.exp index eaed554..5a36507 100644 --- a/gcc/testsuite/lib/gm2-dg.exp +++ b/gcc/testsuite/lib/gm2-dg.exp @@ -65,7 +65,7 @@ proc gm2-dg-runtest { testcases flags default-extra-flags } { if [expr [search_for $test "dg-do run"]] { set option_list $TORTURE_OPTIONS } else { - set option_list [list { -O } ] + set option_list [list { -O -O2 } ] } set nshort [file tail [file dirname $test]]/[file tail $test] @@ -77,3 +77,38 @@ proc gm2-dg-runtest { testcases flags default-extra-flags } { } } + +# Check if frontend has been configured with option. +# This checks a configure build option was used and not +# the availability of a compiler command line option. + +proc gm2-dg-frontend-configure-check { option } { + global GCC_UNDER_TEST + + # ignore any arguments after the command + set compiler [lindex $GCC_UNDER_TEST 0] + + if ![is_remote host] { + set compiler_name [which $compiler] + } else { + set compiler_name $compiler + } + + # verify that the compiler exists + if { $compiler_name != 0 } then { + set tmp [remote_exec host "$compiler -v"] + set status [lindex $tmp 0] + set output [lindex $tmp 1] + regexp "Configured with.*\[\n\r\]" $output config + set option "*${option}*" + if { [string match $option $config] } { + return 1 + } else { + return 0 + } + } else { + # compiler does not exist (this should have already been detected) + warning "$compiler does not exist" + return 0 + } +} diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 24d0b3d..e0495d8 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -7436,19 +7436,6 @@ proc check_effective_target_arm_softfloat { } { }] } -# Return 1 if this is an ARM target supporting -mcpu=iwmmxt. -# Some multilibs may be incompatible with this option. - -proc check_effective_target_arm_iwmmxt_ok { } { - if { [check_effective_target_arm32] } { - return [check_no_compiler_messages arm_iwmmxt_ok object { - int dummy; - } "-mcpu=iwmmxt"] - } else { - return 0 - } -} - # Return true if LDRD/STRD instructions are prefered over LDM/STM instructions # for an ARM target. proc check_effective_target_arm_prefer_ldrd_strd { } { |