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