lineflags.c: New tests.
authorNeil Booth <neilb@earthling.net>
Sat, 9 Dec 2000 12:07:56 +0000 (12:07 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Sat, 9 Dec 2000 12:07:56 +0000 (12:07 +0000)
        * gcc.dg/cpp/lineflags.c: New tests.
        * gcc.dg/cpp/poison.c: Update.
        * gcc.dg/cpp/redef2.c: Update.
        * gcc.dg/cpp/skipping.c: New test.

From-SVN: r38151

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/lineflags.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/poison.c
gcc/testsuite/gcc.dg/cpp/redef2.c
gcc/testsuite/gcc.dg/cpp/skipping.c

index 0c5aca0db2eb3006bef85bfa9dd78d87d76ac192..5282938e4af831c5bafeb3c3e367bfec5cd262a1 100644 (file)
@@ -1,3 +1,10 @@
+2000-12-09  Neil Booth  <neilb@earthling.net>
+
+        * gcc.dg/cpp/lineflags.c: New tests.
+        * gcc.dg/cpp/poison.c: Update.
+        * gcc.dg/cpp/redef2.c: Update.   
+        * gcc.dg/cpp/skipping.c: New test. 
+
 2000-12-07  Geoffrey Keating  <geoffk@redhat.com>
 
        * g++.old-deja/g++.other/eh3.C: New testcase.
diff --git a/gcc/testsuite/gcc.dg/cpp/lineflags.c b/gcc/testsuite/gcc.dg/cpp/lineflags.c
new file mode 100644 (file)
index 0000000..ff11291
--- /dev/null
@@ -0,0 +1,35 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc.  */
+
+/* { dg-do preprocess } */
+/* { dg-options "-fno-show-column" } */
+
+/* This tests whether various combinations of flags are correctly
+   accepted after #line.
+
+   Neil Booth, 8 Dec 2000.  */
+
+#line 12 "file" 3              /* { dg-warning "extra tokens" } */
+
+# 14 "file" 1 1                        /* { dg-error "invalid flag" } */
+# 15 "file" 1 2                        /* { dg-error "invalid flag" } */
+# 16 "file" 1 3 3              /* { dg-error "invalid flag" } */
+# 17 "file" 1 4                        /* { dg-error "invalid flag" } */
+# 18 "file" 2 3 4 4            /* { dg-error "invalid flag" } */
+# 19 "file" 2 4                        /* { dg-error "invalid flag" } */
+# 20 "file" 2 2                        /* { dg-error "invalid flag" } */
+# 21 "file" 2 1                        /* { dg-error "invalid flag" } */
+# 22 "file" 4                  /* { dg-error "invalid flag" } */
+# 23 "file" 4 5                        /* { dg-error "invalid flag" } */
+# 24 "file" 0                  /* { dg-error "invalid flag" } */
+# 25 "file" 5                  /* { dg-error "invalid flag" } */
+# 26 "file" foo                        /* { dg-error "invalid flag" } */
+
+
+# 29 "file" 1                  /* { dg-bogus "invalid flag" } */
+# 30 "file" 2                  /* { dg-bogus "invalid flag" } */
+# 31 "file" 1 3                        /* { dg-bogus "invalid flag" } */
+# 32 "file" 2 3                        /* { dg-bogus "invalid flag" } */
+# 33 "file" 1 3 4              /* { dg-bogus "invalid flag" } */
+# 34 "file" 2 3        4               /* { dg-bogus "invalid flag" } */
+# 35 "file" 3                  /* { dg-bogus "invalid flag" } */
+# 36 "file" 3 4                        /* { dg-bogus "invalid flag" } */
index 3670a76fa8965d95785044d61bb277b768e8c141..fd3f5368eb438d513e670812027eef2b9bb5bd8f 100644 (file)
@@ -15,10 +15,10 @@ foo5                        /* { dg-error "foo5" "use of foo5" } */
 #define foo6 345       /* { dg-error "foo6" "def of foo6" } */
 #define foo6 456       /* { dg-error "foo6" "redef of foo6" } */
 #ifdef foo6            /* { dg-error "foo6" "#ifdef foo6" } */
-#error hey!  foo6 poisoned! /* { dg-error "foo6" "poisoned identifiers" } */
+#error hey! foo6 defined!
 #endif
 #if defined(foo6)      /* { dg-error "foo6" "#if defined foo6" } */
-#error foo6 still poisoned! /* { dg-error "foo6" "poisoned identifiers" } */
+#error foo6 still defined!
 #else
 foo6                   /* { dg-error "foo6" "use of foo6" } */
 #endif
index 5838c47506e4861a0ebdf37ce14ed80f7ff7416e..1656ab8005492d40e04761f7fbaf6fe4c414b61f 100644 (file)
@@ -26,5 +26,5 @@
    { dg-warning "previous"  "prev def ro"   { target *-*-* } 11 }
    { dg-warning "previous"  "prev def va"   { target *-*-* } 14 }
 
-   { dg-warning "named variable"   "named"  { target *-*-* } 14 }
-   { dg-warning "anonymous variable" "anon" { target *-*-* } 15 } */ 
+   { dg-warning "named var" "named variadic"  { target *-*-* } 14 }
+   { dg-warning "anonymous var" "anon variadic" { target *-*-* } 15 } */ 
index d87ea70591ccd130688669fa5b9c32618fc09e08..b8daa890b94c84c30c3526a06659df196883e1c1 100644 (file)
@@ -18,3 +18,8 @@ F(                    /* No diagnostic: don't even try to expand it.  */
 #else
 #error Macros not expanded in #elif
 #endif
+
+/* Check we don't warn about bad identifiers when skipping.  */
+#if 0
+#define foo __VA_ARGS__        /* { dg-bogus "warned about identifier" } */
+#endif