summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/endif.c
blob: c12662cd52ba6b2bdaef97f23f2cc385a904871d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do preprocess } */
/* { dg-options "-pedantic -Wall" } */

/* You can't get away with this in your own code... */
#ifdef KERNEL
#define foo
#endif KERNEL  /* { dg-warning "forbids text after" "good warning" } */

/* This will provoke a warning because the '3' is an extension.  */
#line 10 "endif-label.c" 3 /* { dg-warning "garbage at end" "#line extension" } */

/* ... but in a system header, it's acceptable.  */
#ifdef KERNEL
#define foo
#endif KERNEL  /* { dg-bogus "forbids text after" "bad warning" } */