Commit 97665491 by Neil Booth Committed by Neil Booth

lineflags.c: New tests.

        * 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
parent 28e0f040
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.
......
/* 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" } */
......@@ -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
......
......@@ -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 } */
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment