1 // RUN: pp-trace -callbacks '*,-FileChanged' %s -- -undef -target x86_64 -std=c++11 | FileCheck --strict-whitespace %s
10 #define FUNCMACRO(ARG1) ARG1
12 #define X X_IMPL(a+y,b) X_IMPL2(c)
18 // CHECK-NEXT: - Callback: MacroDefined
19 // CHECK: MacroNameTok: __STDC__
20 // CHECK-NEXT: MacroDirective: MD_Define
21 // CHECK-NEXT: - Callback: MacroDefined
22 // CHECK: MacroNameTok: __STDC_HOSTED__
23 // CHECK-NEXT: MacroDirective: MD_Define
24 // CHECK-NEXT: - Callback: MacroDefined
25 // CHECK: MacroNameTok: __cplusplus
26 // CHECK-NEXT: MacroDirective: MD_Define
27 // CHECK-NEXT: - Callback: MacroDefined
28 // CHECK: MacroNameTok: __STDC_UTF_16__
29 // CHECK-NEXT: MacroDirective: MD_Define
30 // CHECK-NEXT: - Callback: MacroDefined
31 // CHECK: MacroNameTok: __STDC_UTF_32__
32 // CHECK-NEXT: MacroDirective: MD_Define
33 // CHECK: - Callback: MacroDefined
34 // CHECK-NEXT: MacroNameTok: __STDC_EMBED_NOT_FOUND__
35 // CHECK-NEXT: MacroDirective: MD_Define
36 // CHECK: - Callback: MacroDefined
37 // CHECK-NEXT: MacroNameTok: __STDC_EMBED_FOUND__
38 // CHECK-NEXT: MacroDirective: MD_Define
39 // CHECK: - Callback: MacroDefined
40 // CHECK-NEXT: MacroNameTok: __STDC_EMBED_EMPTY__
41 // CHECK-NEXT: MacroDirective: MD_Define
42 // CHECK: - Callback: MacroDefined
43 // CHECK: - Callback: MacroDefined
44 // CHECK-NEXT: MacroNameTok: MACRO
45 // CHECK-NEXT: MacroDirective: MD_Define
46 // CHECK-NEXT: - Callback: MacroExpands
47 // CHECK-NEXT: MacroNameTok: MACRO
48 // CHECK-NEXT: MacroDefinition: [(local)]
49 // CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:4:9", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:4:9"]
50 // CHECK-NEXT: Args: (null)
51 // CHECK-NEXT: - Callback: Defined
52 // CHECK-NEXT: MacroNameTok: MACRO
53 // CHECK-NEXT: MacroDefinition: [(local)]
54 // CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:5", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:19"]
55 // CHECK-NEXT: - Callback: If
56 // CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:2"
57 // CHECK-NEXT: ConditionRange: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:5", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:19"]
58 // CHECK-NEXT: ConditionValue: CVK_True
59 // CHECK-NEXT: - Callback: Endif
60 // CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:6:2"
61 // CHECK-NEXT: IfLoc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:2"
62 // CHECK-NEXT: - Callback: MacroUndefined
63 // CHECK-NEXT: MacroNameTok: MACRO
64 // CHECK-NEXT: MacroDefinition: [(local)]
65 // CHECK-NEXT: - Callback: Defined
66 // CHECK-NEXT: MacroNameTok: MACRO
67 // CHECK-NEXT: MacroDefinition: []
68 // CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:5", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:19"]
69 // CHECK-NEXT: - Callback: If
70 // CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:2"
71 // CHECK-NEXT: ConditionRange: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:5", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:19"]
72 // CHECK-NEXT: ConditionValue: CVK_False
73 // CHECK-NEXT: - Callback: Endif
74 // CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:9:2"
75 // CHECK-NEXT: IfLoc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:2"
76 // CHECK-NEXT: - Callback: SourceRangeSkipped
77 // CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:1", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:9:2"]
78 // CHECK-NEXT: - Callback: MacroDefined
79 // CHECK-NEXT: MacroNameTok: FUNCMACRO
80 // CHECK-NEXT: MacroDirective: MD_Define
81 // CHECK-NEXT: - Callback: MacroExpands
82 // CHECK-NEXT: MacroNameTok: FUNCMACRO
83 // CHECK-NEXT: MacroDefinition: [(local)]
84 // CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:11:9", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:11:20"]
85 // CHECK-NEXT: Args: [1]
86 // CHECK-NEXT: - Callback: MacroDefined
87 // CHECK-NEXT: MacroNameTok: X
88 // CHECK-NEXT: MacroDirective: MD_Define
89 // CHECK-NEXT: - Callback: MacroDefined
90 // CHECK-NEXT: MacroNameTok: X_IMPL
91 // CHECK-NEXT: MacroDirective: MD_Define
92 // CHECK-NEXT: - Callback: MacroDefined
93 // CHECK-NEXT: MacroNameTok: X_IMPL2
94 // CHECK-NEXT: MacroDirective: MD_Define
95 // CHECK-NEXT: - Callback: MacroExpands
96 // CHECK-NEXT: MacroNameTok: X
97 // CHECK-NEXT: MacroDefinition: [(local)]
98 // CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:15:1", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:15:1"]
99 // CHECK-NEXT: Args: (null)
100 // CHECK-NEXT: - Callback: MacroExpands
101 // CHECK-NEXT: MacroNameTok: X_IMPL
102 // CHECK-NEXT: MacroDefinition: [(local)]
103 // CHECK-NEXT: Range: [(nonfile), (nonfile)]
104 // CHECK-NEXT: Args: [a <plus> y, b]
105 // CHECK-NEXT: - Callback: MacroExpands
106 // CHECK-NEXT: MacroNameTok: X_IMPL2
107 // CHECK-NEXT: MacroDefinition: [(local)]
108 // CHECK-NEXT: Range: [(nonfile), (nonfile)]
109 // CHECK-NEXT: Args: [c]
110 // CHECK-NEXT: - Callback: EndOfMainFile