1 | // RUN: %clang_cc1 -Eonly -verify %s |
2 | |
3 | #if 0 |
4 | #if 1 |
5 | #endif junk // shouldn't produce diagnostics |
6 | #endif |
7 | |
8 | #if 0 |
9 | #endif junk // expected-warning{{extra tokens at end of #endif directive}} |
10 | |
11 | #if 1 junk // expected-error{{token is not a valid binary operator in a preprocessor subexpression}} |
12 | #X // shouldn't produce diagnostics (block #if condition not valid, so skipped) |
13 | #else |
14 | #X // expected-error{{invalid preprocessing directive}} |
15 | #endif |
16 | |
17 | #if 0 |
18 | // diagnostics should not be produced until final #endif |
19 | #X |
20 | #include |
21 | #if 1 junk |
22 | #else junk |
23 | #endif junk |
24 | #line -2 |
25 | #error |
26 | #warning |
27 | #endif junk // expected-warning{{extra tokens at end of #endif directive}} |
28 | |