diff options
author | Janis Johnson <janis187@us.ibm.com> | 2006-05-10 22:13:39 +0000 |
---|---|---|
committer | Janis Johnson <janis@gcc.gnu.org> | 2006-05-10 22:13:39 +0000 |
commit | 65c3758b85c410fd6490dfd4580582e13b49ee50 (patch) | |
tree | 88d1e2f31e0e1923f00f0f8d7faf6d5abf916311 | |
parent | 403ac6aca3a1d11c54e1b7cfac9d8d8681f8dba5 (diff) | |
download | gcc-65c3758b85c410fd6490dfd4580582e13b49ee50.zip gcc-65c3758b85c410fd6490dfd4580582e13b49ee50.tar.gz gcc-65c3758b85c410fd6490dfd4580582e13b49ee50.tar.bz2 |
target-supports-dg.exp (check-flags): New.
* lib/target-supports-dg.exp (check-flags): New.
(dg-skip-if): Move flag checks.
From-SVN: r113686
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports-dg.exp | 65 |
2 files changed, 49 insertions, 21 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e21851c..35fbf2d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-05-10 Janis Johnson <janis187@us.ibm.com> + + * lib/target-supports-dg.exp (check-flags): New. + (dg-skip-if): Move flag checks. + 2006-05-09 Steve Ellcey <sje@cup.hp.com> * lib/target-supports-dg.exp (dg-require-cxa-atexit): New. diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp index b361b7f..128ed8f 100644 --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -179,6 +179,40 @@ proc check_test_flags { args } { return $answer } +# Compare flags for a test directive against flags that will be used to +# compile the test: multilib flags, flags for torture options, and either +# the default flags for this group of tests or flags specified with a +# previous dg-options directive. + +proc check-flags { args } { + global compiler_flags + # These variables are from DejaGnu's dg-test. + upvar dg-extra-tool-flags extra_tool_flags + upvar tool_flags tool_flags + + # The args are within another list; pull them out. + set args [lindex $args 0] + + # Start the list with a dummy tool name so the list will match "*" + # if there are no flags. + set compiler_flags " toolname " + append compiler_flags $extra_tool_flags + append compiler_flags $tool_flags + set dest [target_info name] + if [board_info $dest exists multilib_flags] { + append compiler_flags "[board_info $dest multilib_flags] " + } + + # The target list might be an effective-target keyword, so replace + # the original list with "*-*-*", since we already know it matches. + set result [check_conditional_xfail [lreplace $args 1 1 "*-*-*"]] + + # Any value in this variable was left over from an earlier test. + set compiler_flags "" + + return $result +} + # Skip the test (report it as UNSUPPORTED) if the target list and # included flags are matched and the excluded flags are not matched. # @@ -190,35 +224,24 @@ proc check_test_flags { args } { # group of tests or flags specified with a previous dg-options command. proc dg-skip-if { args } { + # Don't bother if we're already skipping the test. + upvar dg-do-what dg-do-what + if { [lindex ${dg-do-what} 1] == "N" } { + return + } + set args [lreplace $args 0 0] set selector [list target [lindex $args 1]] if { [dg-process-target $selector] == "S" } { - # The target list matched; now check the flags. The DejaGnu proc - # check_conditional_xfail will look at the options in compiler_flags, - # so set that up for this test based on flags we know about. Start - # the list with a dummy tool name so the list will match "*" if - # there are no flags. - - global compiler_flags - upvar dg-extra-tool-flags extra_tool_flags - - set compiler_flags " toolname " - append compiler_flags $extra_tool_flags - set dest [target_info name] - if [board_info $dest exists multilib_flags] { - append compiler_flags "[board_info $dest multilib_flags] " - } + # These are defined in DejaGnu's dg-test, needed by check-flags. + upvar dg-extra-tool-flags dg-extra-tool-flags + upvar tool_flags tool_flags - # The target list might be an effective-target keyword, so replace - # the original list with "*-*-*". - if [check_conditional_xfail [lreplace $args 1 1 "*-*-*"]] { + if [check-flags $args] { upvar dg-do-what dg-do-what set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] } - - # Any value in this variable was left over from an earlier test. - set compiler_flags "" } } |