11// This test checks the on-demand scanning of system inputs, in particular:
22// 1. Inputs for unused system modules are not scanned.
33// 2. Imports between system modules are supported and scanned on demand.
4- // 3. Arbitrary modules may be declared in the manifest (modules other than
5- // std and std.compat).
64
75// RUN: split-file %s %t
86
4240// CHECK-NEXT: "[[PREFIX]]/foo.cpp" [ fillcolor=[[COLOR1]],label="{ Kind: Non-module | Filename: [[PREFIX]]/foo.cpp }"];
4341// CHECK-NEXT: "std" [ fillcolor=[[COLOR2:[0-9]+]],label="{ Kind: C++ named module | Module name: std | Filename: [[PREFIX]]/Inputs/usr/lib/share/libc++/v1/std.cppm | Input origin: System | Hash: {{.*}} }"];
4442// CHECK-NEXT: "std.compat" [ fillcolor=[[COLOR2]],label="{ Kind: C++ named module | Module name: std.compat | Filename: [[PREFIX]]/Inputs/usr/lib/share/libc++/v1/std.compat.cppm | Input origin: System | Hash: {{.*}} }"];
45- // CHECK-NEXT: "nonstd " [ fillcolor=[[COLOR2]],label="{ Kind: C++ named module | Module name: nonstd | Filename: [[PREFIX]]/non-std .cxxm | Input origin: System | Hash: {{.*}} }"];
43+ // CHECK-NEXT: "core " [ fillcolor=[[COLOR2]],label="{ Kind: C++ named module | Module name: core | Filename: [[PREFIX]]/core .cxxm | Input origin: System | Hash: {{.*}} }"];
4644
4745// CHECK: "[[PREFIX]]/main.cpp" -> "std";
4846// CHECK-NEXT: "[[PREFIX]]/main.cpp" -> "std.compat";
49- // CHECK-NEXT: "[[PREFIX]]/foo.cpp" -> "nonstd ";
47+ // CHECK-NEXT: "[[PREFIX]]/foo.cpp" -> "core ";
5048// CHECK-NEXT: "std.compat" -> "std";
5149// CHECK-NEXT: }
5250
@@ -56,7 +54,7 @@ import std;
5654import std.compat;
5755
5856// --- foo.cpp
59- import nonstd ;
57+ import core ;
6058
6159// --- std.cppm
6260export module std;
@@ -65,8 +63,11 @@ export module std;
6563export module std.compat;
6664import std;
6765
68- // --- non-std.cxxm
69- export module nonstd;
66+ // The module 'core' is isn't really a system module in libc++ or libstdc++.
67+ // This is only to test that any module marked with '"is-std-library": true' can
68+ // be imported on demand.
69+ // --- core.cxxm
70+ export module core;
7071
7172// --- unused.cppm
7273export module unused;
@@ -87,14 +88,14 @@ export module unused;
8788 " is-std-library" : true
8889 },
8990 {
90- " logical-name" : " nonstd " ,
91- " source-path" : " DIR/non-std .cxxm" ,
92- " is-std-library" : false
91+ " logical-name" : " core " ,
92+ " source-path" : " DIR/core .cxxm" ,
93+ " is-std-library" : true
9394 },
9495 {
9596 " logical-name" : " unused" ,
9697 " source-path" : " DIR/unused.cppm" ,
97- " is-std-library" : false
98+ " is-std-library" : true
9899 }
99100 ]
100101}
0 commit comments