Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Preprocessor / if_warning.c
blobb0b587249cbccc4465d5c45a904425b1591e70e3
1 // RUN: %clang_cc1 %s -Eonly -Werror=undef -verify
3 extern int x;
5 #if foo // expected-error {{'foo' is not defined, evaluates to 0}}
6 #endif
8 // expected-warning@+2 {{use of a '#elifdef' directive is a C23 extension}}
9 #ifdef foo
10 #elifdef foo
11 #endif
13 #if defined(foo)
14 #endif
17 // PR3938
18 // expected-warning@+3 {{use of a '#elifdef' directive is a C23 extension}}
19 #if 0
20 #ifdef D
21 #elifdef D
22 #else 1 // Should not warn due to C99 6.10p4
23 #endif
24 #endif
26 #if 0
27 #else 1 // expected-warning {{extra tokens}}
28 #endif
30 // PR6852
31 #if 'somesillylongthing' // expected-warning {{character constant too long for its type}} \
32 // expected-warning {{multi-character character constant}}
33 #endif