1// RUN: pp-trace %s -- -undef -target x86_64 -std=c++11 | FileCheck --strict-whitespace %s
2
3#include "Inputs/Level1A.h"
4#include "Inputs/Level1B.h"
5
6// CHECK: ---
7// CHECK-NEXT: - Callback: FileChanged
8// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-include.cpp:1:1"
9// CHECK-NEXT: Reason: EnterFile
10// CHECK-NEXT: FileType: C_User
11// CHECK-NEXT: PrevFID: (invalid)
12// CHECK-NEXT: - Callback: FileChanged
13// CHECK-NEXT: Loc: "<built-in>:1:1"
14// CHECK-NEXT: Reason: EnterFile
15// CHECK-NEXT: FileType: C_User
16// CHECK-NEXT: PrevFID: "{{.*}}{{[/\\]}}pp-trace-include.cpp"
17// CHECK-NEXT: - Callback: FileChanged
18// CHECK-NEXT: Loc: "<built-in>:1:1"
19// CHECK-NEXT: Reason: RenameFile
20// CHECK-NEXT: FileType: C_System
21// CHECK-NEXT: PrevFID: (invalid)
22// CHECK-NEXT: - Callback: MacroDefined
23// CHECK: MacroNameTok: __STDC__
24// CHECK-NEXT: MacroDirective: MD_Define
25// CHECK-NEXT: - Callback: MacroDefined
26// CHECK: MacroNameTok: __STDC_HOSTED__
27// CHECK-NEXT: MacroDirective: MD_Define
28// CHECK-NEXT: - Callback: MacroDefined
29// CHECK: MacroNameTok: __cplusplus
30// CHECK-NEXT: MacroDirective: MD_Define
31// CHECK-NEXT: - Callback: MacroDefined
32// CHECK: MacroNameTok: __STDC_UTF_16__
33// CHECK-NEXT: MacroDirective: MD_Define
34// CHECK-NEXT: - Callback: MacroDefined
35// CHECK: MacroNameTok: __STDC_UTF_32__
36// CHECK-NEXT: MacroDirective: MD_Define
37// CHECK: - Callback: FileChanged
38// CHECK-NEXT: Loc: "<command line>:1:1"
39// CHECK-NEXT: Reason: EnterFile
40// CHECK-NEXT: FileType: C_User
41// CHECK-NEXT: PrevFID: (invalid)
42// CHECK: - Callback: MacroDefined
43// CHECK: - Callback: FileChanged
44// CHECK-NEXT: Loc: "<built-in>:1:1"
45// CHECK-NEXT: Reason: ExitFile
46// CHECK-NEXT: FileType: C_User
47// CHECK-NEXT: PrevFID: (invalid)
48// CHECK-NEXT: - Callback: FileChanged
49// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-include.cpp:1:1"
50// CHECK-NEXT: Reason: ExitFile
51// CHECK-NEXT: FileType: C_User
52// CHECK-NEXT: PrevFID: (getFileEntryForID failed)
53// CHECK-NEXT: - Callback: InclusionDirective
54// CHECK-NEXT: HashLoc: "{{.*}}{{[/\\]}}pp-trace-include.cpp:3:1"
55// CHECK-NEXT: IncludeTok: include
56// CHECK-NEXT: FileName: "Inputs/Level1A.h"
57// CHECK-NEXT: IsAngled: false
58// CHECK-NEXT: FilenameRange: "Inputs/Level1A.h"
59// CHECK-NEXT: File: "{{.*}}{{[/\\]}}Inputs/Level1A.h"
60// CHECK-NEXT: SearchPath: "{{.*}}{{[/\\]}}pp-trace"
61// CHECK-NEXT: RelativePath: "Inputs/Level1A.h"
62// CHECK-NEXT: SuggestedModule: (null)
63// CHECK-NEXT: ModuleImported: false
64// CHECK-NEXT: - Callback: FileChanged
65// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}Inputs/Level1A.h:1:1"
66// CHECK-NEXT: Reason: EnterFile
67// CHECK-NEXT: FileType: C_User
68// CHECK-NEXT: PrevFID: "{{.*}}{{[/\\]}}pp-trace-include.cpp"
69// CHECK-NEXT: - Callback: InclusionDirective
70// CHECK-NEXT: HashLoc: "{{.*}}{{[/\\]}}Inputs/Level1A.h:1:1"
71// CHECK-NEXT: IncludeTok: include
72// CHECK-NEXT: FileName: "Level2A.h"
73// CHECK-NEXT: IsAngled: false
74// CHECK-NEXT: FilenameRange: "Level2A.h"
75// CHECK-NEXT: File: "{{.*}}{{[/\\]}}Inputs/Level2A.h"
76// CHECK-NEXT: SearchPath: "{{.*}}{{[/\\]}}Inputs"
77// CHECK-NEXT: RelativePath: "Level2A.h"
78// CHECK-NEXT: SuggestedModule: (null)
79// CHECK-NEXT: ModuleImported: false
80// CHECK-NEXT: - Callback: FileChanged
81// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}Inputs/Level2A.h:1:1"
82// CHECK-NEXT: Reason: EnterFile
83// CHECK-NEXT: FileType: C_User
84// CHECK-NEXT: PrevFID: "{{.*}}{{[/\\]}}Inputs/Level1A.h"
85// CHECK-NEXT: - Callback: MacroDefined
86// CHECK-NEXT: MacroNameTok: MACRO_2A
87// CHECK-NEXT: MacroDirective: MD_Define
88// CHECK-NEXT: - Callback: FileChanged
89// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}Inputs/Level1A.h:2:1"
90// CHECK-NEXT: Reason: ExitFile
91// CHECK-NEXT: FileType: C_User
92// CHECK-NEXT: PrevFID: "{{.*}}{{[/\\]}}Inputs/Level2A.h"
93// CHECK-NEXT: - Callback: MacroDefined
94// CHECK-NEXT: MacroNameTok: MACRO_1A
95// CHECK-NEXT: MacroDirective: MD_Define
96// CHECK-NEXT: - Callback: FileChanged
97// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-include.cpp:4:1"
98// CHECK-NEXT: Reason: ExitFile
99// CHECK-NEXT: FileType: C_User
100// CHECK-NEXT: PrevFID: "{{.*}}{{[/\\]}}Inputs/Level1A.h"
101// CHECK-NEXT: - Callback: InclusionDirective
102// CHECK-NEXT: HashLoc: "{{.*}}{{[/\\]}}pp-trace-include.cpp:4:1"
103// CHECK-NEXT: IncludeTok: include
104// CHECK-NEXT: FileName: "Inputs/Level1B.h"
105// CHECK-NEXT: IsAngled: false
106// CHECK-NEXT: FilenameRange: "Inputs/Level1B.h"
107// CHECK-NEXT: File: "{{.*}}{{[/\\]}}Inputs/Level1B.h"
108// CHECK-NEXT: SearchPath: "{{.*}}{{[/\\]}}pp-trace"
109// CHECK-NEXT: RelativePath: "Inputs/Level1B.h"
110// CHECK-NEXT: SuggestedModule: (null)
111// CHECK-NEXT: ModuleImported: false
112// CHECK-NEXT: - Callback: FileChanged
113// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}Inputs/Level1B.h:1:1"
114// CHECK-NEXT: Reason: EnterFile
115// CHECK-NEXT: FileType: C_User
116// CHECK-NEXT: PrevFID: "{{.*}}{{[/\\]}}pp-trace-include.cpp"
117// CHECK-NEXT: - Callback: InclusionDirective
118// CHECK-NEXT: HashLoc: "{{.*}}{{[/\\]}}Inputs/Level1B.h:1:1"
119// CHECK-NEXT: IncludeTok: include
120// CHECK-NEXT: FileName: "Level2B.h"
121// CHECK-NEXT: IsAngled: false
122// CHECK-NEXT: FilenameRange: "Level2B.h"
123// CHECK-NEXT: File: "{{.*}}{{[/\\]}}Inputs/Level2B.h"
124// CHECK-NEXT: SearchPath: "{{.*}}{{[/\\]}}Inputs"
125// CHECK-NEXT: RelativePath: "Level2B.h"
126// CHECK-NEXT: SuggestedModule: (null)
127// CHECK-NEXT: ModuleImported: false
128// CHECK-NEXT: - Callback: FileChanged
129// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}Inputs/Level2B.h:1:1"
130// CHECK-NEXT: Reason: EnterFile
131// CHECK-NEXT: FileType: C_User
132// CHECK-NEXT: PrevFID: "{{.*}}{{[/\\]}}Inputs/Level1B.h"
133// CHECK-NEXT: - Callback: MacroDefined
134// CHECK-NEXT: MacroNameTok: MACRO_2B
135// CHECK-NEXT: MacroDirective: MD_Define
136// CHECK-NEXT: - Callback: FileChanged
137// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}Inputs/Level1B.h:2:1"
138// CHECK-NEXT: Reason: ExitFile
139// CHECK-NEXT: FileType: C_User
140// CHECK-NEXT: PrevFID: "{{.*}}{{[/\\]}}Inputs/Level2B.h"
141// CHECK-NEXT: - Callback: MacroDefined
142// CHECK-NEXT: MacroNameTok: MACRO_1B
143// CHECK-NEXT: MacroDirective: MD_Define
144// CHECK-NEXT: - Callback: FileChanged
145// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-include.cpp:5:1"
146// CHECK-NEXT: Reason: ExitFile
147// CHECK-NEXT: FileType: C_User
148// CHECK-NEXT: PrevFID: "{{.*}}{{[/\\]}}Inputs/Level1B.h"
149// CHECK-NEXT: - Callback: EndOfMainFile
150// CHECK-NEXT: ...
151

source code of clang-tools-extra/test/pp-trace/pp-trace-include.cpp