xref: /minix3/external/bsd/llvm/dist/clang/test/Preprocessor/warn-disabled-macro-expansion.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -E -Wdisabled-macro-expansion -verify
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc #define p p
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc #define a b
6*f4a2713aSLionel Sambuc #define b a
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc #define f(a) a
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc #define g(b) a
11*f4a2713aSLionel Sambuc 
12*f4a2713aSLionel Sambuc #define h(x) i(x)
13*f4a2713aSLionel Sambuc #define i(y) i(y)
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc #define c(x) x(0)
16*f4a2713aSLionel Sambuc 
17*f4a2713aSLionel Sambuc #define y(x) y
18*f4a2713aSLionel Sambuc #define z(x) (z)(x)
19*f4a2713aSLionel Sambuc 
20*f4a2713aSLionel Sambuc p // no warning
21*f4a2713aSLionel Sambuc 
22*f4a2713aSLionel Sambuc a // expected-warning {{recursive macro}}
23*f4a2713aSLionel Sambuc 
24*f4a2713aSLionel Sambuc f(2)
25*f4a2713aSLionel Sambuc 
26*f4a2713aSLionel Sambuc g(3) // expected-warning {{recursive macro}}
27*f4a2713aSLionel Sambuc 
28*f4a2713aSLionel Sambuc h(0) // expected-warning {{recursive macro}}
29*f4a2713aSLionel Sambuc 
30*f4a2713aSLionel Sambuc c(c) // expected-warning {{recursive macro}}
31*f4a2713aSLionel Sambuc 
32*f4a2713aSLionel Sambuc y(5) // expected-warning {{recursive macro}}
33*f4a2713aSLionel Sambuc 
34*f4a2713aSLionel Sambuc z(z) // ok
35*f4a2713aSLionel Sambuc 
36