stringize_misc.c 661 B

123456789101112131415161718192021222324252627282930
  1. // RUN: %clang_cc1 -E %s | FileCheck -strict-whitespace %s
  2. #define M(x, y) #x #y
  3. M( f(1, 2), g((x=y++, y)))
  4. // CHECK: "f(1, 2)" "g((x=y++, y))"
  5. M( {a=1 , b=2;} ) /* A semicolon is not a comma */
  6. // CHECK: "{a=1" "b=2;}"
  7. M( <, [ ) /* Passes the arguments < and [ */
  8. // CHECK: "<" "["
  9. M( (,), (...) ) /* Passes the arguments (,) and (...) */
  10. // CHECK: "(,)" "(...)"
  11. #define START_END(start, end) start c=3; end
  12. START_END( {a=1 , b=2;} ) /* braces are not parentheses */
  13. // CHECK: {a=1 c=3; b=2;}
  14. /*
  15. * To pass a comma token as an argument it is
  16. * necessary to write:
  17. */
  18. #define COMMA ,
  19. M(a COMMA b, (a, b))
  20. // CHECK: "a COMMA b" "(a, b)"