2012-01-04 04:13:03 +08:00
|
|
|
// RUN: %clang_cc1 %s -E -Wdisabled-macro-expansion -verify
|
|
|
|
|
|
|
|
#define p p
|
|
|
|
|
|
|
|
#define a b
|
|
|
|
#define b a
|
|
|
|
|
|
|
|
#define f(a) a
|
|
|
|
|
|
|
|
#define g(b) a
|
|
|
|
|
|
|
|
#define h(x) i(x)
|
|
|
|
#define i(y) i(y)
|
|
|
|
|
|
|
|
#define c(x) x(0)
|
|
|
|
|
2013-01-31 07:10:17 +08:00
|
|
|
#define y(x) y
|
2012-12-12 10:46:14 +08:00
|
|
|
#define z(x) (z)(x)
|
|
|
|
|
2013-01-31 07:10:17 +08:00
|
|
|
p // no warning
|
2012-01-04 04:13:03 +08:00
|
|
|
|
|
|
|
a // expected-warning {{recursive macro}}
|
|
|
|
|
|
|
|
f(2)
|
|
|
|
|
|
|
|
g(3) // expected-warning {{recursive macro}}
|
|
|
|
|
|
|
|
h(0) // expected-warning {{recursive macro}}
|
|
|
|
|
|
|
|
c(c) // expected-warning {{recursive macro}}
|
2012-12-12 10:46:14 +08:00
|
|
|
|
2013-01-31 07:10:17 +08:00
|
|
|
y(5) // expected-warning {{recursive macro}}
|
|
|
|
|
2012-12-12 10:46:14 +08:00
|
|
|
z(z) // ok
|
2013-01-31 07:10:17 +08:00
|
|
|
|