annotate gcc/testsuite/gcc.dg/cpp/unc4.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do preprocess } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 /* Tests for un-terminated conditional diagnostics.
kono
parents:
diff changeset
4 Copyright (c) 1999 Free Software Foundation.
kono
parents:
diff changeset
5 Contributed by Zack Weinberg, who made it up all by himself. */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 #endif /* { dg-error "#endif" "#endif without #if" } */
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 #else /* { dg-error "#else" "#else without #if" } */
kono
parents:
diff changeset
10 #endif /* { dg-error "#endif" "#endif after #else without #if" } */
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 #elif 0 /* { dg-error "#elif" "#elif without #if" } */
kono
parents:
diff changeset
13 #endif /* { dg-error "#endif" "#endif after #else without #if" } */
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 #if 1 /* { dg-bogus "unterminated" "terminated true conditional" } */
kono
parents:
diff changeset
16 blah
kono
parents:
diff changeset
17 #endif
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 #if 0 /* { dg-bogus "unterminated" "terminated false conditional" } */
kono
parents:
diff changeset
20 ignored
kono
parents:
diff changeset
21 #endif
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* We shouldn't see unbalanced conditionals inside #if'ed out #includes. */
kono
parents:
diff changeset
24 #if 0
kono
parents:
diff changeset
25 #include "unc1.c"
kono
parents:
diff changeset
26 #endif
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* The ifdef below should not get an error just because there's a bad if
kono
parents:
diff changeset
29 inside the included file.
kono
parents:
diff changeset
30 The odd dg-error tag on the include matches the "In file included from"
kono
parents:
diff changeset
31 message. */
kono
parents:
diff changeset
32 #define FOO
kono
parents:
diff changeset
33 #ifdef FOO /* { dg-bogus "unterminated" "nested unterm" } */
kono
parents:
diff changeset
34 #include "unc1.c" /* { dg-message "file included from" "" { target *-*-* } 0 } */
kono
parents:
diff changeset
35 #endif
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 /* dg.exp doesn't read the included files for tags, so we have to
kono
parents:
diff changeset
38 do them explicitly here. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
39 /* { dg-error "-:#if" "unc1.c: unterminated #if" { target *-*-* } 4 } */