blob: 6dea09d1130a4bf7552cd3cb9234f9cf216ee2a6 [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001// Example from C99 6.10.3.4p5
Daniel Dunbara5728872009-12-15 20:14:24 +00002// RUN: %clang_cc1 -E %s | FileCheck -strict-whitespace %s
Reid Spencer5f016e22007-07-11 17:01:13 +00003
4#define x 3
5#define f(a) f(x * (a))
6#undef x
7#define x 2
8#define g f
9#define z z[0]
10#define h g(~
11#define m(a) a(w)
12#define w 0,1
13#define t(a) a
14#define p() int
15#define q(x) x
16#define r(x,y) x ## y
17#define str(x) # x
18 f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
19 g(x+(3,4)-w) | h 5) & m
20(f)^m(m);
21p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) };
22char c[2][6] = { str(hello), str() };
23
Edward O'Callaghanb396a372009-10-27 02:36:32 +000024// CHECK: f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
25// CHECK: f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
26// CHECK: int i[] = { 1, 23, 4, 5, };
27// CHECK: char c[2][6] = { "hello", "" };
Reid Spencer5f016e22007-07-11 17:01:13 +000028