output_paste_avoid.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck -strict-whitespace %s
  2. #define y(a) ..a
  3. A: y(.)
  4. // This should print as ".. ." to avoid turning into ...
  5. // CHECK: A: .. .
  6. #define X 0 .. 1
  7. B: X
  8. // CHECK: B: 0 .. 1
  9. #define DOT .
  10. C: ..DOT
  11. // CHECK: C: .. .
  12. #define PLUS +
  13. #define EMPTY
  14. #define f(x) =x=
  15. D: +PLUS -EMPTY- PLUS+ f(=)
  16. // CHECK: D: + + - - + + = = =
  17. #define test(x) L#x
  18. E: test(str)
  19. // Should expand to L "str" not L"str"
  20. // CHECK: E: L "str"
  21. // Should avoid producing >>=.
  22. #define equal =
  23. F: >>equal
  24. // CHECK: F: >> =
  25. // Make sure we don't introduce spaces in the guid because we try to avoid
  26. // pasting '-' to a numeric constant.
  27. #define TYPEDEF(guid) typedef [uuid(guid)]
  28. TYPEDEF(66504301-BE0F-101A-8BBB-00AA00300CAB) long OLE_COLOR;
  29. // CHECK: typedef [uuid(66504301-BE0F-101A-8BBB-00AA00300CAB)] long OLE_COLOR;
  30. // Be careful with UD-suffixes.
  31. #define StrSuffix() "abc"_suffix
  32. #define IntSuffix() 123_suffix
  33. UD: StrSuffix()ident
  34. UD: IntSuffix()ident
  35. // CHECK: UD: "abc"_suffix ident
  36. // CHECK: UD: 123_suffix ident