diff options
author | Chris Lattner <sabre@nondot.org> | 2006-07-30 07:20:09 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-07-30 07:20:09 +0000 |
commit | 022b62e94154d05f329c90eff1802c9130055076 (patch) | |
tree | adbbc55c55977b078d05ef5f3154a6916261bc23 /clang/test/Preprocessor/stringize_misc.c | |
parent | a5722f5a5665788b818c8da1949594feb17dbb33 (diff) | |
download | bcm5719-llvm-022b62e94154d05f329c90eff1802c9130055076.tar.gz bcm5719-llvm-022b62e94154d05f329c90eff1802c9130055076.zip |
new testcase
llvm-svn: 38798
Diffstat (limited to 'clang/test/Preprocessor/stringize_misc.c')
-rw-r--r-- | clang/test/Preprocessor/stringize_misc.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/stringize_misc.c b/clang/test/Preprocessor/stringize_misc.c new file mode 100644 index 00000000000..b8e4480ef83 --- /dev/null +++ b/clang/test/Preprocessor/stringize_misc.c @@ -0,0 +1,26 @@ +// RUN: clang -E %s | grep -F '"f(1, 2)" "g((x=y++, y))"' && +// RUN: clang -E %s | grep -F '"{a=1" "b=2;}"' && +// RUN: clang -E %s | grep -F '"<" "["' && +// RUN: clang -E %s | grep -F '"(,)" "(...)"' && +// RUN: clang -E %s | grep -F '{a=1 c=3; b=2;}' && +// RUN: clang -E %s | grep -F '"a COMMA b" "(a, b)"' + +#define M(x, y) #x #y + +M( f(1, 2), g((x=y++, y))) +M( {a=1 , b=2;} ) /* A semicolon is not a comma */ +M( <, [ ) /* Passes the arguments < and [ */ +M( (,), (...) ) /* Passes the arguments (,) and (...) */ + +#define START_END(start, end) start c=3; end + +START_END( {a=1 , b=2;} ) /* braces are not parentheses */ + +/* + * To pass a comma token as an argument it is + * necessary to write: + */ +#define COMMA , + +M(a COMMA b, (a, b)) + |