blob: 5bc2236f0c45710b9435fbad804216179ef574ef [file] [log] [blame]
Richard Smitheb3ce7c2011-12-16 22:50:01 +00001// RUN: %clang_cc1 %s -fsyntax-only -verify
2
Richard Smith5edd5832012-08-30 13:38:46 +00003#define a(x) enum { x }
4a(n =
5#undef a
6#define a 5
7 a);
8_Static_assert(n == 5, "");
9
Richard Smitheb3ce7c2011-12-16 22:50:01 +000010// header1.h
11void fail(const char *);
12#define MUNCH(...) \
13 ({ int result = 0; __VA_ARGS__; if (!result) { fail(#__VA_ARGS__); }; result })
14
15static inline int f(int k) {
16 return MUNCH( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{returning 'void'}}
17 if (k < 3)
18 result = 24;
19 else if (k > 4)
20 result = k - 4;
21}
22
23#include "macro_arg_directive.h" // expected-error {{embedding a #include directive within macro arguments is not supported}}
24
25int g(int k) {
26 return f(k) + f(k-1));
27}