diff options
author | Janis Johnson <janis187@us.ibm.com> | 2008-05-21 18:03:32 +0000 |
---|---|---|
committer | Janis Johnson <janis@gcc.gnu.org> | 2008-05-21 18:03:32 +0000 |
commit | 00a25a2d39c992235f57f6d891a407144236760c (patch) | |
tree | 74ac640467fdfcb0d90754fa3d1b5fd0dd43b621 /gcc | |
parent | 80980aecc61c7c892d37cc6dd28511c76e80863e (diff) | |
download | gcc-00a25a2d39c992235f57f6d891a407144236760c.zip gcc-00a25a2d39c992235f57f6d891a407144236760c.tar.gz gcc-00a25a2d39c992235f57f6d891a407144236760c.tar.bz2 |
sourcebuild.texi (Test Directives): Add dg-xfail-run-if.
gcc/
* doc/sourcebuild.texi (Test Directives): Add dg-xfail-run-if.
gcc/testsuite/
* lib/target-supports-dg.exp (dg-xfail-run-if): New.
* gcc.test-framework/dg-do-run-xrif-exp-F.c: New test.
* gcc.test-framework/dg-do-run-xrif-exp-P.c: New test.
* gcc.test-framework/dg-do-run-xrif-exp-XF.c: New test.
* gcc.test-framework/dg-do-run-xrif-exp-XP.c: New test.
* gcc.test-framework/dg-dot-run-xrif-exp-F.c: New test.
* gcc.test-framework/dg-dot-run-xrif-exp-P.c: New test.
* gcc.test-framework/dg-dot-run-xrif-exp-XF.c: New test.
* gcc.test-framework/dg-dot-run-xrif-exp-XP.c: New test.
* gcc.test-framework/test-framework.awk: Handle new tests.
From-SVN: r135729
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/doc/sourcebuild.texi | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-F.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-P.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-XF.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-XP.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-F.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-P.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-XF.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-XP.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.test-framework/test-framework.awk | 4 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports-dg.exp | 24 |
13 files changed, 129 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 661505b..125cc45 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2008-05-21 Janis Johnson <janis187@us.ibm.com> + + * doc/sourcebuild.texi (Test Directives): Add dg-xfail-run-if. + 2008-05-21 H.J. Lu <hongjiu.lu@intel.com> * config/i386/sse.md (vec_extractv4sf): Removed. diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 6c551aa..635c716 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1004,7 +1004,11 @@ an empty @var{exclude-opts} list. @item @{ dg-xfail-if @var{comment} @{ @var{selector} @} @{ @var{include-opts} @} @{ @var{exclude-opts} @} @} Expect the test to fail if the conditions (which are the same as for -@code{dg-skip-if}) are met. +@code{dg-skip-if}) are met. This does not affect the execute step. + +@item @{ dg-xfail-run-if @var{comment} @{ @var{selector} @} @{ @var{include-opts} @} @{ @var{exclude-opts} @} @} +Expect the execute step of a test to fail if the conditions (which are +the same as for @code{dg-skip-if}) and @code{dg-xfail-if}) are met. @item @{ dg-require-@var{support} args @} Skip the test if the target does not provide the required support; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e2e4323..5600a40 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2008-05-21 Janis Johnson <janis187@us.ibm.com> + + * lib/target-supports-dg.exp (dg-xfail-run-if): New. + * gcc.test-framework/dg-do-run-xrif-exp-F.c: New test. + * gcc.test-framework/dg-do-run-xrif-exp-P.c: New test. + * gcc.test-framework/dg-do-run-xrif-exp-XF.c: New test. + * gcc.test-framework/dg-do-run-xrif-exp-XP.c: New test. + * gcc.test-framework/dg-dot-run-xrif-exp-F.c: New test. + * gcc.test-framework/dg-dot-run-xrif-exp-P.c: New test. + * gcc.test-framework/dg-dot-run-xrif-exp-XF.c: New test. + * gcc.test-framework/dg-dot-run-xrif-exp-XP.c: New test. + * gcc.test-framework/test-framework.awk: Handle new tests. + 2008-05-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/36257 diff --git a/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-F.c b/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-F.c new file mode 100644 index 0000000..01459ea --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-F.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ +/* { dg-xfail-run-if "" { empty-*-* } { "*" } { "" } } */ + +extern void abort (void); + +int +main () +{ + abort (); /* This results in a failure. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-P.c new file mode 100644 index 0000000..d3472ab --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-P.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ +/* { dg-xfail-run-if "" { empty-*-* } { "*" } { "" } } */ + +extern void abort (void); + +int +main () +{ + return 0; /* This results in a pass. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-XF.c b/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-XF.c new file mode 100644 index 0000000..0a0a1f8 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-XF.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ +/* { dg-xfail-run-if "" { *-*-* } { "*" } { "" } } */ + +extern void abort (void); + +int +main () +{ + abort (); /* This results in an expected failure. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-XP.c b/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-XP.c new file mode 100644 index 0000000..6f418689 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-run-xrif-exp-XP.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ +/* { dg-xfail-run-if "" { *-*-* } { "*" } { "" } } */ + +extern void abort (void); + +int +main () +{ + return 0; /* This results in unexpected pass. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-F.c b/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-F.c new file mode 100644 index 0000000..3011799 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-F.c @@ -0,0 +1,10 @@ +/* { dg-do run { xfail *-empty-* } } */ +/* { dg-xfail-run-if "" { empty-*-* } { "*" } { "" } } */ + +extern void abort (void); + +int +main () +{ + abort (); /* Neither xfail list matched, so fail. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-P.c new file mode 100644 index 0000000..5bb9220 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-P.c @@ -0,0 +1,10 @@ +/* { dg-do run { xfail *-empty-* } } */ +/* { dg-xfail-run-if "" { empty-*-* } { "*" } { "" } } */ + +extern void abort (void); + +int +main () +{ + return 0; /* Neither xfail list matched, so pass. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-XF.c b/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-XF.c new file mode 100644 index 0000000..854f1cb --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-XF.c @@ -0,0 +1,10 @@ +/* { dg-do run { xfail *-*-* } } */ +/* { dg-xfail-run-if "" { empty-*-* } { "*" } { "" } } */ + +extern void abort (void); + +int +main () +{ + abort (); /* A failed match doesn't override an existing XFAIL. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-XP.c b/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-XP.c new file mode 100644 index 0000000..f1ac0c1 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-dot-run-xrif-exp-XP.c @@ -0,0 +1,10 @@ +/* { dg-do run { xfail empty-*-* } } */ +/* { dg-xfail-run-if "" { *-*-* } { "*" } { "" } } */ + +extern void abort (void); + +int +main () +{ + return 0; /* First xfail list didn't match but second did, so XPASS. */ +} diff --git a/gcc/testsuite/gcc.test-framework/test-framework.awk b/gcc/testsuite/gcc.test-framework/test-framework.awk index 9df6874..381d347 100644 --- a/gcc/testsuite/gcc.test-framework/test-framework.awk +++ b/gcc/testsuite/gcc.test-framework/test-framework.awk @@ -3,7 +3,7 @@ # of passing tests. # # -# Copyright (c) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (c) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -47,6 +47,8 @@ BEGIN { skip = 1; passes = 0; fails = 0; } /dg-outexists.*\(test for excess errors)/ { ignore(); next } /dg-outexists.*\(test for warnings/ { ignore(); next } /dg-outexists.*\(test for errors/ { ignore(); next } +# ignore compile step for dg-xfail-run-if tests. +/run-xrif.*\(test for excess errors)/ { ignore(); next } # The other dox tests pass the compile step; ignore that message. /^PASS.*dox.*\(test for excess errors\)/ { ignore(); next } # The sf tests pass the compile step; ignore that message. diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp index c4731c1..4bff5fa 100644 --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -294,6 +294,30 @@ proc dg-xfail-if { args } { } } +# Like dg-xfail-if but for the execute step. + +proc dg-xfail-run-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" } { + # 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 + + if [check-flags $args] { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "S" "F"] + } + } +} + # Record whether the program is expected to return a nonzero status. set shouldfail 0 |