[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Preprocessor / stringize_misc.c
blobfc7253e50499b41432d2d3157a81371da66cb4a4
1 #ifdef TEST1
2 // RUN: %clang_cc1 -E %s -DTEST1 | FileCheck -strict-whitespace %s
4 #define M(x, y) #x #y
6 M( f(1, 2), g((x=y++, y)))
7 // CHECK: "f(1, 2)" "g((x=y++, y))"
9 M( {a=1 , b=2;} ) /* A semicolon is not a comma */
10 // CHECK: "{a=1" "b=2;}"
12 M( <, [ ) /* Passes the arguments < and [ */
13 // CHECK: "<" "["
15 M( (,), (...) ) /* Passes the arguments (,) and (...) */
16 // CHECK: "(,)" "(...)"
18 #define START_END(start, end) start c=3; end
20 START_END( {a=1 , b=2;} ) /* braces are not parentheses */
21 // CHECK: {a=1 c=3; b=2;}
23 /*
24 * To pass a comma token as an argument it is
25 * necessary to write:
26 */
27 #define COMMA ,
29 M(a COMMA b, (a, b))
30 // CHECK: "a COMMA b" "(a, b)"
32 #endif
34 #ifdef TEST2
35 // RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST2
37 #define HASH #
38 #define INVALID() #
39 // expected-error@-1{{'#' is not followed by a macro parameter}}
41 #endif