This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[3.4 PATCH] backport dg-skip-if


This patch copies the current version of dg-skip-if from mainline to the
3.4 branch.  It provides a new way to skip a test, making it unsupported
for a particular target.  Kaveh asked for this a few weeks ago.  Tested
by running C and C++ testsuites for powerpc64-unknown-linux-gnu with
-m32 and -m64 with "make -j 4 check", and with special-purpose tests for
directives.

OK for the 3.4 branch?

2005-01-24  Janis Johnson  <janis187@us.ibm.com>

	* lib/gcc-dg.exp (dg-skip-if): New.

--- gcc/testsuite/lib/gcc-dg.exp.orig	2005-01-24 10:37:19.000000000 -0800
+++ gcc/testsuite/lib/gcc-dg.exp	2005-01-24 10:40:45.000000000 -0800
@@ -359,6 +359,49 @@ proc dg-require-named-sections { args } 
    }
 }
 
+# Skip the test (report it as UNSUPPORTED) if the target list and
+# included flags are matched and the excluded flags are not matched.
+#
+# The first argument is the line number of the dg-skip-if directive
+# within the test file.   Remaining arguments are as for xfail lists:
+# message { targets } { include } { exclude }
+#
+# This tests against multilib flags plus either the default flags for this
+# group of tests or flags specified with a previous dg-options command.
+
+proc dg-skip-if { args } {
+    set args [lreplace $args 0 0]
+
+    set selector "target [join [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] "
+	}
+
+	# The target list might be an effective-target keyword, so replace
+	# the original list with "*-*-*".
+	if [check_conditional_xfail [lreplace $args 1 1 "*-*-*"]] {
+	    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 ""
+    }
+}
+
 # Prune any messages matching ARGS[1] (a regexp) from test output.
 proc dg-prune-output { args } {
     global additional_prunes


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]