t_1_012.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. http://www.boost.org/
  4. Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
  5. Software License, Version 1.0. (See accompanying file
  6. LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. =============================================================================*/
  8. // Test, if function like macros are correctly expanded if used as object like
  9. // macros
  10. #define CAT(a, b) a ## b
  11. #define ARGS (1, 2)
  12. //R #line 18 "t_1_012.cpp"
  13. //R CAT (1, 2)
  14. CAT ARGS
  15. #define INVOKE(macro) macro ARGS
  16. //R #line 24 "t_1_012.cpp"
  17. //R CAT (1, 2)
  18. INVOKE(CAT)
  19. #define EXPAND(x) x
  20. //R #line 30 "t_1_012.cpp"
  21. //R 12
  22. EXPAND(CAT ARGS)
  23. //H 10: t_1_012.cpp(13): #define
  24. //H 08: t_1_012.cpp(13): CAT(a, b)=a ## b
  25. //H 10: t_1_012.cpp(14): #define
  26. //H 08: t_1_012.cpp(14): ARGS=(1, 2)
  27. //H 01: t_1_012.cpp(14): ARGS
  28. //H 02: (1, 2)
  29. //H 03: (1, 2)
  30. //H 10: t_1_012.cpp(20): #define
  31. //H 08: t_1_012.cpp(20): INVOKE(macro)=macro ARGS
  32. //H 00: t_1_012.cpp(24): INVOKE(CAT), [t_1_012.cpp(20): INVOKE(macro)=macro ARGS]
  33. //H 02: CAT ARGS
  34. //H 01: t_1_012.cpp(14): ARGS
  35. //H 02: (1, 2)
  36. //H 03: (1, 2)
  37. //H 03: CAT (1, 2)
  38. //H 10: t_1_012.cpp(26): #define
  39. //H 08: t_1_012.cpp(26): EXPAND(x)=x
  40. //H 00: t_1_012.cpp(30): EXPAND(CAT ARGS), [t_1_012.cpp(26): EXPAND(x)=x]
  41. //H 01: t_1_012.cpp(14): ARGS
  42. //H 02: (1, 2)
  43. //H 03: (1, 2)
  44. //H 02: CAT (1, 2)
  45. //H 00: t_1_012.cpp(30): CAT(1, 2), [t_1_012.cpp(13): CAT(a, b)=a ## b]
  46. //H 02: 12
  47. //H 03: 12
  48. //H 03: 12