1 /* Copyright (C) 2000, 2008 Free Software Foundation, Inc. */
3 /* { dg-do preprocess } */
4 /* { dg-options "-Wno-deprecated" } */
6 /* Tests all directives that do not permit excess tokens at the end of
9 /* Source: Neil Booth, 4 Dec 2000. The combination of separate test
12 #ifdef foo bar /* { dg-warning "extra tokens" "tokens after #ifdef" } */
15 #ifndef foo bar /* { dg-warning "extra tokens" "tokens after #ifndef" } */
20 #else foo /* { dg-warning "extra tokens" "tokens after #else" } */
21 #endif / /* { dg-warning "extra tokens" "tokens after #endif" } */
24 #undef foo bar /* { dg-warning "extra tokens" "tokens after #undef" } */
26 #assert foo(bar) bar /* { dg-warning "extra tokens" "tokens after #assert" } */
28 #unassert foo(bar) b /* { dg-warning "extra tokens" "tokens after #unassert" } */
30 #include "mi1c.h" bar /* { dg-warning "extra tokens" "tokens after #include" } */
32 #ident "something" bar /* { dg-warning "extra tokens" "tokens after #ident" } */
36 /* ... but in a system header, it's acceptable. */
38 #endif KERNEL /* { dg-bogus "extra tokens" "bad warning" } */