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
This commit is contained in:
parent
28e0f04034
commit
9766549120
5 changed files with 51 additions and 4 deletions
|
@ -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.
|
||||
|
|
35
gcc/testsuite/gcc.dg/cpp/lineflags.c
Normal file
35
gcc/testsuite/gcc.dg/cpp/lineflags.c
Normal file
|
@ -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" } */
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue