blob: b8e4480ef83601ebb45c57de4330e6248b44f1fd [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001// RUN: clang -E %s | grep -F '"f(1, 2)" "g((x=y++, y))"' &&
2// RUN: clang -E %s | grep -F '"{a=1" "b=2;}"' &&
3// RUN: clang -E %s | grep -F '"<" "["' &&
4// RUN: clang -E %s | grep -F '"(,)" "(...)"' &&
5// RUN: clang -E %s | grep -F '{a=1 c=3; b=2;}' &&
6// RUN: clang -E %s | grep -F '"a COMMA b" "(a, b)"'
7
8#define M(x, y) #x #y
9
10M( f(1, 2), g((x=y++, y)))
11M( {a=1 , b=2;} ) /* A semicolon is not a comma */
12M( <, [ ) /* Passes the arguments < and [ */
13M( (,), (...) ) /* Passes the arguments (,) and (...) */
14
15#define START_END(start, end) start c=3; end
16
17START_END( {a=1 , b=2;} ) /* braces are not parentheses */
18
19/*
20 * To pass a comma token as an argument it is
21 * necessary to write:
22 */
23#define COMMA ,
24
25M(a COMMA b, (a, b))
26