dump_macros.c 812 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // RUN: %clang_cc1 -E -dM %s -o - | FileCheck %s -strict-whitespace
  2. // Space at end even without expansion tokens
  3. // CHECK: #define A(x)
  4. #define A(x)
  5. // Space before expansion list.
  6. // CHECK: #define B(x,y) x y
  7. #define B(x,y)x y
  8. // No space in argument list.
  9. // CHECK: #define C(x,y) x y
  10. #define C(x, y) x y
  11. // No paste avoidance.
  12. // CHECK: #define D() ..
  13. #define D() ..
  14. // Simple test.
  15. // CHECK: #define E .
  16. // CHECK: #define F X()Y
  17. #define E .
  18. #define F X()Y
  19. // gcc prints macros at end of translation unit, so last one wins.
  20. // CHECK: #define G 2
  21. #define G 1
  22. #undef G
  23. #define G 2
  24. // Variadic macros of various sorts. PR5699
  25. // CHECK: H(x,...) __VA_ARGS__
  26. #define H(x, ...) __VA_ARGS__
  27. // CHECK: I(...) __VA_ARGS__
  28. #define I(...) __VA_ARGS__
  29. // CHECK: J(x...) __VA_ARGS__
  30. #define J(x ...) __VA_ARGS__