summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.test-framework
diff options
context:
space:
mode:
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-07 00:08:32 +0000
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-07 00:08:32 +0000
commit3dfef819d79660d4c38cf6ad2f9e09fa912a3f6b (patch)
treed7d574cf62797eef3062a916b1322eb815dab24c /gcc/testsuite/gcc.test-framework
parent9fbc4e9e16c6ffd0b88fedb03a0b4193227a856a (diff)
downloadgcc-3dfef819d79660d4c38cf6ad2f9e09fa912a3f6b.tar.gz
gcc/
2006-11-06 Janis Johnson <janis187@us.ibm.com> * gcc/doc/sourcebuild.texi (Test Directives): Add output-exists and output-exists-not. gcc/testsuite/ 2006-11-06 Janis Johnson <janis187@us.ibm.com Bernhard Fischer <aldot@gcc.gnu.org> * lib/gcc-dg.exp (output-exists): New proc. (output-exists-not): New proc. * gcc.test-framework/test-framework.awk: Support new directives. * gcc.test-framework/dg-outexistsnot-exp-F.c: New test. * gcc.test-framework/dg-outexistsnot-exp-P.c: New test. * gcc.test-framework/dg-outexists-exp-F.c: New test. * gcc.test-framework/dg-outexists-exp-XP.c: New test. * gcc.test-framework/dg-outexistsnot-exp-XF.c: New test. * gcc.test-framework/dg-outexists-exp-P.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118531 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.test-framework')
-rw-r--r--gcc/testsuite/gcc.test-framework/dg-outexists-exp-F.c7
-rw-r--r--gcc/testsuite/gcc.test-framework/dg-outexists-exp-P.c5
-rw-r--r--gcc/testsuite/gcc.test-framework/dg-outexists-exp-XP.c5
-rw-r--r--gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-F.c5
-rw-r--r--gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-P.c7
-rw-r--r--gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-XF.c5
-rw-r--r--gcc/testsuite/gcc.test-framework/test-framework.awk13
7 files changed, 42 insertions, 5 deletions
diff --git a/gcc/testsuite/gcc.test-framework/dg-outexists-exp-F.c b/gcc/testsuite/gcc.test-framework/dg-outexists-exp-F.c
new file mode 100644
index 00000000000..397ec68a204
--- /dev/null
+++ b/gcc/testsuite/gcc.test-framework/dg-outexists-exp-F.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-W -Werror" } */
+
+int main (void) { 0; } /* { dg-warning "no effect" } */
+
+/* { dg-warning "warnings being treated as errors" "" { target *-*-* } 0 } */
+/* { dg-final { output-exists { target *-*-* } } } */
diff --git a/gcc/testsuite/gcc.test-framework/dg-outexists-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-outexists-exp-P.c
new file mode 100644
index 00000000000..04ed266e890
--- /dev/null
+++ b/gcc/testsuite/gcc.test-framework/dg-outexists-exp-P.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+
+int main (void) { return 0; }
+
+/* { dg-final { output-exists } } */
diff --git a/gcc/testsuite/gcc.test-framework/dg-outexists-exp-XP.c b/gcc/testsuite/gcc.test-framework/dg-outexists-exp-XP.c
new file mode 100644
index 00000000000..61e40ee2c82
--- /dev/null
+++ b/gcc/testsuite/gcc.test-framework/dg-outexists-exp-XP.c
@@ -0,0 +1,5 @@
+/* { dg-do assemble } */
+
+int main (void) { return 0; }
+
+/* { dg-final { output-exists { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-F.c b/gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-F.c
new file mode 100644
index 00000000000..f9d58ab2a3d
--- /dev/null
+++ b/gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-F.c
@@ -0,0 +1,5 @@
+/* { dg-do link } */
+
+int main (void) { return 0; }
+
+/* { dg-final { output-exists-not { target bogus-bogus-bogus } } } */
diff --git a/gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-P.c
new file mode 100644
index 00000000000..0076752410b
--- /dev/null
+++ b/gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-P.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-W -Werror" } */
+
+int main (void) { 0; } /* { dg-warning "no effect" } */
+
+/* { dg-warning "warnings being treated as errors" "" { target *-*-* } 0 } */
+/* { dg-final { output-exists-not { target *-*-* } } } */
diff --git a/gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-XF.c b/gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-XF.c
new file mode 100644
index 00000000000..818685b5c54
--- /dev/null
+++ b/gcc/testsuite/gcc.test-framework/dg-outexistsnot-exp-XF.c
@@ -0,0 +1,5 @@
+/* { dg-do link } */
+
+int main (void) { return 0; }
+
+/* { dg-final { output-exists-not { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.test-framework/test-framework.awk b/gcc/testsuite/gcc.test-framework/test-framework.awk
index 4c1436fe74d..daefa0ce51c 100644
--- a/gcc/testsuite/gcc.test-framework/test-framework.awk
+++ b/gcc/testsuite/gcc.test-framework/test-framework.awk
@@ -40,17 +40,20 @@ BEGIN { skip = 1; passes = 0; fails = 0; }
/^PASS.*-2.c/ { ignore(); next }
# dg-xfail-if applies to the compile step; these should be XPASS for the
# compile step on dox tests, which are run tests.
-/^XPASS.*dox.*xiff.*-1.c.*(test for excess errors)/ { ignore(); next }
+/^XPASS.*dox.*xiff.*-1.c.*\(test for excess errors\)/ { ignore(); next }
# xfail for scan-assembler-not tests doesn't apply to the compile step.
-/^PASS.*sa.*-1.c.*(test for excess errors)/ { ignore(); next }
+/^PASS.*sa.*-1.c.*\(test for excess errors\)/ { ignore(); next }
+# ignore compile step, tests for warnings for output-exists[-not] tests.
+/dg-outexists.*\(test for excess errors)/ { ignore(); next }
+/dg-outexists.*\(test for warnings/ { ignore(); next }
# The other dox tests pass the compile step; ignore that message.
-/^PASS.*dox.*(test for excess errors)/ { ignore(); next }
+/^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 }
+/^PASS.*sf.*\(test for excess errors\)/ { ignore(); next }
# Ignore lines that begin with comma.
/^,/ { ignore(); next }
# For tests of dg-output, ignore successful compilation.
-/^PASS.*dg-output.*(test for excess error)/ { ignore(); next }
+/^PASS.*dg-output.*\(test for excess errors\)/ { ignore(); next }
# For tests of dg-output, ignore successful execution.
/^PASS.*dg-output.*execution test/ { ignore(); next }
/^PASS/ { if (match ($0, "exp-P")) { pass(); next } }