diff options
author | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-13 22:58:07 +0000 |
---|---|---|
committer | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-13 22:58:07 +0000 |
commit | c7a67206aa1b13e4ef7e808ceb695847d19a404e (patch) | |
tree | 16059cfdc327445328728cd69a9c3c6758161309 /gcc/testsuite/gcc.test-framework | |
parent | faece7b81b6348faa56358ccba7b79af7910bee8 (diff) | |
download | gcc-c7a67206aa1b13e4ef7e808ceb695847d19a404e.tar.gz |
gcc:
* doc/sourcebuild.texi (Test Directives): Document dg-shouldfail.
gcc/testsuite:
* lib/gcc-dg.exp (tool_load): Wrapper to support shouldfail tests.
(dg-test): Support shouldfail tests.
* lib/target-supports-dg.exp (dg-shouldfail): New.
* gcc.test-framework/test-framework.awk: Handle shouldfail tests.
* gcc.test-framework/dg-do-run-sf-exp-F.c: New test.
* gcc.test-framework/dg-do-run-sf-exp-P.c: New test.
* gcc.test-framework/dg-do-run-sft-exp-F.c: New test.
* gcc.test-framework/dg-do-run-sft-exp-P.c: New test.
* gcc.test-framework/dg-dox-run-sf-exp-XF.c: New test.
* gcc.test-framework/dg-dox-run-sf-exp-XP.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115424 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.test-framework')
7 files changed, 59 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.test-framework/dg-do-run-sf-exp-F.c b/gcc/testsuite/gcc.test-framework/dg-do-run-sf-exp-F.c new file mode 100644 index 00000000000..076c14c5260 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-run-sf-exp-F.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-shouldfail "required comment" } */ + +int +main () +{ + return 0; /* We expect nonzero, so this fails. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-do-run-sf-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-do-run-sf-exp-P.c new file mode 100644 index 00000000000..6e9dd849c59 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-run-sf-exp-P.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ +/* { dg-shouldfail "required comment" } */ + +extern void abort (void); + +int +main () +{ + abort (); /* We expect nonzero, so this passes. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-do-run-sft-exp-F.c b/gcc/testsuite/gcc.test-framework/dg-do-run-sft-exp-F.c new file mode 100644 index 00000000000..8695bd66a2b --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-run-sft-exp-F.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ +/* { dg-shouldfail "comment" { unknown-*-* } { "*" } { "" } } */ + +extern void abort (void); + +int +main () +{ + abort (); /* Directive is ignored so we expect zero; this fails. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-do-run-sft-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-do-run-sft-exp-P.c new file mode 100644 index 00000000000..0695df9142b --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-run-sft-exp-P.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ +/* { dg-shouldfail "comment" { *-*-* } { "*" } { "" } } */ + +extern void abort (void); + +int +main () +{ + abort (); /* We expect nonzero exit, so this passes. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-dox-run-sf-exp-XF.c b/gcc/testsuite/gcc.test-framework/dg-dox-run-sf-exp-XF.c new file mode 100644 index 00000000000..e5eae7775c4 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-dox-run-sf-exp-XF.c @@ -0,0 +1,8 @@ +/* { dg-do run { xfail *-*-* } } */ +/* { dg-shouldfail "required comment" } */ + +int +main () +{ + return 0; /* We want nonzero but expect to fail; XFAIL. */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-dox-run-sf-exp-XP.c b/gcc/testsuite/gcc.test-framework/dg-dox-run-sf-exp-XP.c new file mode 100644 index 00000000000..59b5f8be21f --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-dox-run-sf-exp-XP.c @@ -0,0 +1,10 @@ +/* { dg-do run { xfail *-*-* } } */ +/* { dg-shouldfail "required comment" } */ + +extern void abort (void); + +int +main () +{ + abort (); /* We want nonzero, but expect to fail; XPASS. */ +} diff --git a/gcc/testsuite/gcc.test-framework/test-framework.awk b/gcc/testsuite/gcc.test-framework/test-framework.awk index 30ff13d6e2d..4c1436fe74d 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 Free Software Foundation, Inc. +# Copyright (c) 2004, 2005, 2006 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 @@ -45,6 +45,8 @@ BEGIN { skip = 1; passes = 0; fails = 0; } /^PASS.*sa.*-1.c.*(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. +/^PASS.*sf.*(test for excess errors)/ { ignore(); next } # Ignore lines that begin with comma. /^,/ { ignore(); next } # For tests of dg-output, ignore successful compilation. |