xref: /minix3/external/bsd/llvm/dist/clang/test/Preprocessor/ifdef-recover.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /* RUN: %clang_cc1 -E -verify %s
2f4a2713aSLionel Sambuc  */
3f4a2713aSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc /* expected-error@+1 {{macro name missing}} */
5f4a2713aSLionel Sambuc #ifdef
6f4a2713aSLionel Sambuc #endif
7f4a2713aSLionel Sambuc 
8*0a6a1f1dSLionel Sambuc /* expected-error@+1 {{macro name must be an identifier}} */
9*0a6a1f1dSLionel Sambuc #ifdef !
10*0a6a1f1dSLionel Sambuc #endif
11*0a6a1f1dSLionel Sambuc 
12*0a6a1f1dSLionel Sambuc /* expected-error@+1 {{macro name missing}} */
13*0a6a1f1dSLionel Sambuc #if defined
14*0a6a1f1dSLionel Sambuc #endif
15*0a6a1f1dSLionel Sambuc 
16f4a2713aSLionel Sambuc /* PR1936 */
17*0a6a1f1dSLionel Sambuc /* expected-error@+2 {{unterminated function-like macro invocation}} expected-error@+2 {{expected value in expression}} expected-note@+1 {{macro 'f' defined here}} */
18f4a2713aSLionel Sambuc #define f(x) x
19f4a2713aSLionel Sambuc #if f(2
20f4a2713aSLionel Sambuc #endif
21f4a2713aSLionel Sambuc 
22f4a2713aSLionel Sambuc int x;
23