1 /* { dg-do preprocess } */
3 /* Tests for un-terminated conditional diagnostics.
4 Copyright (c) 1999 Free Software Foundation.
5 Contributed by Zack Weinberg, who made it up all by himself. */
7 #endif /* { dg-error "#endif" "#endif without #if" } */
9 #else /* { dg-error "#else" "#else without #if" } */
10 #endif /* { dg-error "#endif" "#endif after #else without #if" } */
12 #elif 0 /* { dg-error "#elif" "#elif without #if" } */
13 #endif /* { dg-error "#endif" "#endif after #else without #if" } */
15 #if 1 /* { dg-bogus "unterminated" "terminated true conditional" } */
19 #if 0 /* { dg-bogus "unterminated" "terminated false conditional" } */
23 /* We shouldn't see unbalanced conditionals inside #if'ed out #includes. */
28 /* The ifdef below should not get an error just because there's a bad if
29 inside the included file.
30 The odd dg-error tag on the include matches the "In file included from"
33 #ifdef FOO /* { dg-bogus "unterminated" "nested unterm" } */
34 #include "cpp-unc1.c" /* { dg-error "" } */
37 /* dg.exp doesn't read the included files for tags, so we have to
38 do them explicitly here. */
39 /* { dg-error "#if" "unc1.h: unterminated #if" { target native } 3 } */