[Reland][Runtimes] Merge 'compile_commands.json' files from runtimes build (#116303)
[llvm-project.git] / clang / test / Preprocessor / ifdef-recover.c
blob07d92a635e051f79a9bdaf218960a8154685d1f9
1 /* RUN: %clang_cc1 -E -verify %s
2 */
4 /* expected-error@+1 {{macro name missing}} */
5 #ifdef
6 #endif
8 /* expected-error@+1 {{macro name must be an identifier}} */
9 #ifdef !
10 #endif
12 /* expected-error@+1 {{macro name missing}} */
13 #if defined
14 #endif
16 /* PR1936 */
17 /* expected-error@+2 {{unterminated function-like macro invocation}} expected-error@+2 {{expected value in expression}} expected-note@+1 {{macro 'f' defined here}} */
18 #define f(x) x
19 #if f(2
20 #endif
22 /* expected-error@+3 {{macro name missing}} */
23 /* expected-warning@+2 {{use of a '#elifdef' directive is a C23 extension}} */
24 #ifdef FOO
25 #elifdef
26 #endif
28 /* expected-error@+3 {{macro name must be an identifier}} */
29 /* expected-warning@+2 {{use of a '#elifdef' directive is a C23 extension}} */
30 #ifdef FOO
31 #elifdef !
32 #endif
34 int x;