1 /* { dg-do preprocess } */
2 /* { dg-options "-fno-show-column" } */
4 /* Tests for un-terminated conditional diagnostics.
5 Copyright (c) 1999 Free Software Foundation.
6 Contributed by Zack Weinberg, who made it up all by himself. */
8 #endif /* { dg-error "#endif" "#endif without #if" } */
10 #else /* { dg-error "#else" "#else without #if" } */
11 #endif /* { dg-error "#endif" "#endif after #else without #if" } */
13 #elif 0 /* { dg-error "#elif" "#elif without #if" } */
14 #endif /* { dg-error "#endif" "#endif after #else without #if" } */
16 #if 1 /* { dg-bogus "unterminated" "terminated true conditional" } */
20 #if 0 /* { dg-bogus "unterminated" "terminated false conditional" } */
24 /* We shouldn't see unbalanced conditionals inside #if'ed out #includes. */
29 /* The ifdef below should not get an error just because there's a bad if
30 inside the included file.
31 The odd dg-error tag on the include matches the "In file included from"
34 #ifdef FOO /* { dg-bogus "unterminated" "nested unterm" } */
35 #include "unc1.c" /* { dg-error "" } */
38 /* dg.exp doesn't read the included files for tags, so we have to
39 do them explicitly here. */
40 /* { dg-error "#if" "unc1.c: unterminated #if" { target *-*-* } 4 } */