diff --git a/clang-tools-extra/test/pp-trace/Inputs/Level1B.h b/clang-tools-extra/test/pp-trace/Inputs/Level1B.h index 4f15d6c37d1a..1e607987e63f 100644 --- a/clang-tools-extra/test/pp-trace/Inputs/Level1B.h +++ b/clang-tools-extra/test/pp-trace/Inputs/Level1B.h @@ -1 +1,2 @@ +#include "Level2B.h" #define MACRO_1B 1 diff --git a/clang-tools-extra/test/pp-trace/Inputs/Level2B.h b/clang-tools-extra/test/pp-trace/Inputs/Level2B.h new file mode 100644 index 000000000000..25b70179c934 --- /dev/null +++ b/clang-tools-extra/test/pp-trace/Inputs/Level2B.h @@ -0,0 +1 @@ +#define MACRO_2B 1 diff --git a/clang-tools-extra/test/pp-trace/Inputs/ModularizeList.txt b/clang-tools-extra/test/pp-trace/Inputs/ModularizeList.txt index 41a6217ea97e..8193db6a6262 100644 --- a/clang-tools-extra/test/pp-trace/Inputs/ModularizeList.txt +++ b/clang-tools-extra/test/pp-trace/Inputs/ModularizeList.txt @@ -1,3 +1,4 @@ Level1A.h Level1B.h Level2A.h +Level2B.h diff --git a/clang-tools-extra/test/pp-trace/Inputs/module.map b/clang-tools-extra/test/pp-trace/Inputs/module.map index bb224a907bf2..31f33c5bb149 100644 --- a/clang-tools-extra/test/pp-trace/Inputs/module.map +++ b/clang-tools-extra/test/pp-trace/Inputs/module.map @@ -1,5 +1,4 @@ // module.map -// Generated by: modularize -module-map-path=module.map ModularizeList.txt module Level1A { header "Level1A.h" @@ -8,6 +7,10 @@ module Level1A { module Level1B { header "Level1B.h" export * + module Level2B { + header "Level2B.h" + export * + } } module Level2A { header "Level2A.h" diff --git a/clang-tools-extra/test/pp-trace/pp-trace-include.cpp b/clang-tools-extra/test/pp-trace/pp-trace-include.cpp index a715c51747a5..63fa7aa26a98 100644 --- a/clang-tools-extra/test/pp-trace/pp-trace-include.cpp +++ b/clang-tools-extra/test/pp-trace/pp-trace-include.cpp @@ -107,6 +107,28 @@ // CHECK-NEXT: Reason: EnterFile // CHECK-NEXT: FileType: C_User // CHECK-NEXT: PrevFID: (invalid) +// CHECK-NEXT: - Callback: InclusionDirective +// CHECK-NEXT: IncludeTok: include +// CHECK-NEXT: FileName: "Level2B.h" +// CHECK-NEXT: IsAngled: false +// CHECK-NEXT: FilenameRange: "Level2B.h" +// CHECK-NEXT: File: "{{.*}}{{[/\\]}}Inputs/Level2B.h" +// CHECK-NEXT: SearchPath: "{{.*}}{{[/\\]}}Inputs" +// CHECK-NEXT: RelativePath: "Level2B.h" +// CHECK-NEXT: Imported: (null) +// CHECK-NEXT: - Callback: FileChanged +// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}Inputs/Level2B.h:1:1" +// CHECK-NEXT: Reason: EnterFile +// CHECK-NEXT: FileType: C_User +// CHECK-NEXT: PrevFID: (invalid) +// CHECK-NEXT: - Callback: MacroDefined +// CHECK-NEXT: MacroNameTok: MACRO_2B +// CHECK-NEXT: MacroDirective: MD_Define +// CHECK-NEXT: - Callback: FileChanged +// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}Inputs/Level1B.h:2:1" +// CHECK-NEXT: Reason: ExitFile +// CHECK-NEXT: FileType: C_User +// CHECK-NEXT: PrevFID: "{{.*}}{{[/\\]}}Inputs/Level2B.h" // CHECK-NEXT: - Callback: MacroDefined // CHECK-NEXT: MacroNameTok: MACRO_1B // CHECK-NEXT: MacroDirective: MD_Define diff --git a/clang-tools-extra/test/pp-trace/pp-trace-modules.cpp b/clang-tools-extra/test/pp-trace/pp-trace-modules.cpp index d6f1f61fbcd2..58a2b4bd3395 100644 --- a/clang-tools-extra/test/pp-trace/pp-trace-modules.cpp +++ b/clang-tools-extra/test/pp-trace/pp-trace-modules.cpp @@ -1,11 +1,16 @@ // RUN: pp-trace -ignore FileChanged,MacroDefined %s -x objective-c++ -undef -target x86_64 -std=c++11 -fmodules -fcxx-modules -fmodules-cache-path=%t -I%S -I%S/Input | FileCheck --strict-whitespace %s @import Level1A; +@import Level1B.Level2B; // CHECK: --- // CHECK-NEXT: - Callback: moduleImport // CHECK-NEXT: ImportLoc: "{{.*}}{{[/\\]}}pp-trace-modules.cpp:3:2" // CHECK-NEXT: Path: [{Name: Level1A, Loc: "{{.*}}{{[/\\]}}pp-trace-modules.cpp:3:9"}] // CHECK-NEXT: Imported: Level1A +// CHECK-NEXT: - Callback: moduleImport +// CHECK-NEXT: ImportLoc: "{{.*}}{{[/\\]}}pp-trace-modules.cpp:4:2" +// CHECK-NEXT: Path: [{Name: Level1B, Loc: "{{.*}}{{[/\\]}}pp-trace-modules.cpp:4:9"}, {Name: Level2B, Loc: "{{.*}}{{[/\\]}}pp-trace-modules.cpp:4:17"}] +// CHECK-NEXT: Imported: Level2B // CHECK-NEXT: - Callback: EndOfMainFile // CHECK-NEXT: ...