llvm-capstone/clang/test/Preprocessor/ifdef-recover.c
Alp Toker b05e0b53b9 Preprocessor: support defined() with operator names for MS compatibility
Also flesh out missing tests, improve diagnostic QOI and fix a couple of corner
cases found in the process.

Fixes PR10606.

llvm-svn: 209276
2014-05-21 06:13:51 +00:00

23 lines
463 B
C

/* RUN: %clang_cc1 -E -verify %s
*/
/* expected-error@+1 {{macro name missing}} */
#ifdef
#endif
/* expected-error@+1 {{macro name must be an identifier}} */
#ifdef !
#endif
/* expected-error@+1 {{macro name missing}} */
#if defined
#endif
/* PR1936 */
/* expected-error@+2 {{unterminated function-like macro invocation}} expected-error@+2 {{expected value in expression}} expected-note@+1 {{macro 'f' defined here}} */
#define f(x) x
#if f(2
#endif
int x;