Skip to content

Commit dc4e85b

Browse files
committed
[C++20] [Modules] Remove hardcoded path to imported module in BMIs
Close #62707 As we discussed before, we'll forbid the use of implicit generated path for C++20 modules. And as I mentioned in #62707, we've emitted a warning for clang17 and we'll make it a hard error in clang18. And the patch addresses the decision.
1 parent aa2a96a commit dc4e85b

20 files changed

+123
-118
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ C/C++ Language Potentially Breaking Changes
7474
outlined in "The Equality Operator You Are Looking For" (`P2468 <http://wg21.link/p2468r2>`_).
7575
Fixes (`#68901: <https://github.com/llvm/llvm-project/issues/68901>`_).
7676

77+
- Remove the hardcoded path to the imported modules for C++20 named modules. Now we
78+
require all the dependent modules to specified from the command line.
79+
See (`#62707: <https://github.com/llvm/llvm-project/issues/62707>`_).
80+
7781
C++ Specific Potentially Breaking Changes
7882
-----------------------------------------
7983
- The name mangling rules for function templates has been changed to take into

clang/include/clang/Basic/DiagnosticSerializationKinds.td

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,8 @@ def warn_module_system_bit_conflict : Warning<
129129
"as a non-system module; any difference in diagnostic options will be ignored">,
130130
InGroup<ModuleConflict>;
131131

132-
def warn_reading_std_cxx_module_by_implicit_paths : Warning<
133-
"it is deprecated to read module '%0' implicitly; it is going to be removed in clang 18; "
134-
"consider to specify the dependencies explicitly">,
135-
InGroup<DiagGroup<"read-modules-implicitly">>;
132+
def err_failed_to_find_module_file : Error<
133+
"failed to find module file for module '%0'">;
136134
} // let CategoryName
137135

138136
let CategoryName = "AST Serialization Issue" in {

clang/lib/Serialization/ASTReader.cpp

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,12 +3037,17 @@ ASTReader::ReadControlBlock(ModuleFile &F,
30373037
// location info are setup, in ReadAST.
30383038
SourceLocation ImportLoc =
30393039
ReadUntranslatedSourceLocation(Record[Idx++]);
3040-
off_t StoredSize = (off_t)Record[Idx++];
3041-
time_t StoredModTime = (time_t)Record[Idx++];
3042-
auto FirstSignatureByte = Record.begin() + Idx;
3043-
ASTFileSignature StoredSignature = ASTFileSignature::create(
3044-
FirstSignatureByte, FirstSignatureByte + ASTFileSignature::size);
3045-
Idx += ASTFileSignature::size;
3040+
off_t StoredSize = !IsImportingStdCXXModule ? (off_t)Record[Idx++] : 0;
3041+
time_t StoredModTime =
3042+
!IsImportingStdCXXModule ? (time_t)Record[Idx++] : 0;
3043+
3044+
ASTFileSignature StoredSignature;
3045+
if (!IsImportingStdCXXModule) {
3046+
auto FirstSignatureByte = Record.begin() + Idx;
3047+
StoredSignature = ASTFileSignature::create(
3048+
FirstSignatureByte, FirstSignatureByte + ASTFileSignature::size);
3049+
Idx += ASTFileSignature::size;
3050+
}
30463051

30473052
std::string ImportedName = ReadString(Record, Idx);
30483053
std::string ImportedFile;
@@ -3057,18 +3062,19 @@ ASTReader::ReadControlBlock(ModuleFile &F,
30573062
ImportedFile = PP.getHeaderSearchInfo().getPrebuiltModuleFileName(
30583063
ImportedName, /*FileMapOnly*/ !IsImportingStdCXXModule);
30593064

3060-
if (ImportedFile.empty()) {
3061-
// It is deprecated for C++20 Named modules to use the implicitly
3062-
// paths.
3063-
if (IsImportingStdCXXModule)
3064-
Diag(clang::diag::warn_reading_std_cxx_module_by_implicit_paths)
3065-
<< ImportedName;
3066-
3067-
// Use BaseDirectoryAsWritten to ensure we use the same path in the
3068-
// ModuleCache as when writing.
3069-
ImportedFile = ReadPath(BaseDirectoryAsWritten, Record, Idx);
3070-
} else
3071-
SkipPath(Record, Idx);
3065+
// For C++20 Modules, we won't record the path to the imported modules
3066+
// in the BMI
3067+
if (!IsImportingStdCXXModule) {
3068+
if (ImportedFile.empty()) {
3069+
// Use BaseDirectoryAsWritten to ensure we use the same path in the
3070+
// ModuleCache as when writing.
3071+
ImportedFile = ReadPath(BaseDirectoryAsWritten, Record, Idx);
3072+
} else
3073+
SkipPath(Record, Idx);
3074+
} else if (ImportedFile.empty()) {
3075+
Diag(clang::diag::err_failed_to_find_module_file) << ImportedName;
3076+
return Missing;
3077+
}
30723078

30733079
// If our client can't cope with us being out of date, we can't cope with
30743080
// our dependency being missing.
@@ -5584,8 +5590,23 @@ bool ASTReader::readASTFileControlBlock(
55845590
while (Idx < N) {
55855591
// Read information about the AST file.
55865592

5587-
// Kind, StandardCXXModule, ImportLoc, Size, ModTime, Signature
5588-
Idx += 1 + 1 + 1 + 1 + 1 + ASTFileSignature::size;
5593+
// Skip Kind
5594+
Idx++;
5595+
bool IsStandardCXXModule = Record[Idx++];
5596+
5597+
// Skip ImportLoc
5598+
Idx++;
5599+
5600+
// In C++20 Modules, we don't record the path to imported
5601+
// modules in the BMI files.
5602+
if (IsStandardCXXModule) {
5603+
std::string ModuleName = ReadString(Record, Idx);
5604+
Listener.visitImport(ModuleName, /*Filename=*/"");
5605+
continue;
5606+
}
5607+
5608+
// Skip Size, ModTime and Signature
5609+
Idx += 1 + 1 + ASTFileSignature::size;
55895610
std::string ModuleName = ReadString(Record, Idx);
55905611
std::string Filename = ReadString(Record, Idx);
55915612
ResolveImportedPath(Filename, ModuleDir);

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,15 +1411,20 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
14111411
Record.push_back(M.StandardCXXModule);
14121412
AddSourceLocation(M.ImportLoc, Record);
14131413

1414-
// If we have calculated signature, there is no need to store
1415-
// the size or timestamp.
1416-
Record.push_back(M.Signature ? 0 : M.File.getSize());
1417-
Record.push_back(M.Signature ? 0 : getTimestampForOutput(M.File));
1418-
1419-
llvm::append_range(Record, M.Signature);
1414+
// We don't want to hard code the information about imported modules
1415+
// in the C++20 named modules.
1416+
if (!M.StandardCXXModule) {
1417+
// If we have calculated signature, there is no need to store
1418+
// the size or timestamp.
1419+
Record.push_back(M.Signature ? 0 : M.File.getSize());
1420+
Record.push_back(M.Signature ? 0 : getTimestampForOutput(M.File));
1421+
llvm::append_range(Record, M.Signature);
1422+
}
14201423

14211424
AddString(M.ModuleName, Record);
1422-
AddPath(M.FileName, Record);
1425+
1426+
if (!M.StandardCXXModule)
1427+
AddPath(M.FileName, Record);
14231428
}
14241429
Stream.EmitRecord(IMPORTS, Record);
14251430
}

clang/test/CodeGenCXX/module-initializer-guard-elision.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,34 @@
88
// RUN: -o - | FileCheck %s --check-prefix=CHECK-O
99

1010
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 P.cpp \
11-
// RUN: -emit-module-interface -fmodule-file=O=O.pcm -o P.pcm
11+
// RUN: -emit-module-interface -fprebuilt-module-path=%t -o P.pcm
1212
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 P.pcm -S -emit-llvm \
13-
// RUN: -o - | FileCheck %s --check-prefix=CHECK-P
13+
// RUN: -fprebuilt-module-path=%t -o - | FileCheck %s --check-prefix=CHECK-P
1414

1515
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 Q.cpp \
1616
// RUN: -emit-module-interface -o Q.pcm
1717
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 Q.pcm -S -emit-llvm \
1818
// RUN: -o - | FileCheck %s --check-prefix=CHECK-Q
1919

2020
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 R.cpp \
21-
// RUN: -emit-module-interface -fmodule-file=Q=Q.pcm -o R.pcm
21+
// RUN: -emit-module-interface -fprebuilt-module-path=%t -o R.pcm
2222
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 R.pcm -S -emit-llvm \
23-
// RUN: -o - | FileCheck %s --check-prefix=CHECK-R
23+
// RUN: -fprebuilt-module-path=%t -o - | FileCheck %s --check-prefix=CHECK-R
2424

2525
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 S.cpp \
26-
// RUN: -emit-module-interface -fmodule-file=Q=Q.pcm -fmodule-file=R=R.pcm -o S.pcm
26+
// RUN: -emit-module-interface -fprebuilt-module-path=%t -o S.pcm
2727
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 S.pcm -S -emit-llvm \
28-
// RUN: -o - | FileCheck %s --check-prefix=CHECK-S
28+
// RUN: -fprebuilt-module-path=%t -o - | FileCheck %s --check-prefix=CHECK-S
2929

3030
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 T.cpp \
31-
// RUN: -emit-module-interface -fmodule-file=S=S.pcm -fmodule-file=R=R.pcm -o T.pcm
31+
// RUN: -emit-module-interface -fprebuilt-module-path=%t -o T.pcm
3232
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 T.pcm -S -emit-llvm \
33-
// RUN: -o - | FileCheck %s --check-prefix=CHECK-T
33+
// RUN: -fprebuilt-module-path=%t -o - | FileCheck %s --check-prefix=CHECK-T
3434

3535
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 U.cpp \
36-
// RUN: -emit-module-interface -fmodule-file=T=T.pcm -fmodule-file=R=R.pcm -o U.pcm
36+
// RUN: -emit-module-interface -fprebuilt-module-path=%t -o U.pcm
3737
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 U.pcm -S -emit-llvm \
38-
// RUN: -o - | FileCheck %s --check-prefix=CHECK-U
38+
// RUN: -fprebuilt-module-path=%t -o - | FileCheck %s --check-prefix=CHECK-U
3939

4040
// Testing cases where we can elide the module initializer guard variable.
4141

clang/test/CodeGenCXX/module-intializer.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,35 @@
1212
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 O.pcm -S -emit-llvm \
1313
// RUN: -o - | FileCheck %s --check-prefix=CHECK-O
1414

15-
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 M-part.cpp \
16-
// RUN: -emit-module-interface -o M-part.pcm
17-
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 M-part.pcm -S \
18-
// RUN: -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-P
15+
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 M-Part.cpp \
16+
// RUN: -emit-module-interface -o M-Part.pcm
17+
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 M-Part.pcm -S \
18+
// RUN: -emit-module-interface -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-P
1919

2020
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 M.cpp \
21-
// RUN: -fmodule-file=N=N.pcm -fmodule-file=O=O.pcm -fmodule-file=M:Part=M-part.pcm \
22-
// RUN: -emit-module-interface -o M.pcm
21+
// RUN: -fprebuilt-module-path=%t -emit-module-interface -o M.pcm
2322
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 M.pcm -S -emit-llvm \
24-
// RUN: -o - | FileCheck %s --check-prefix=CHECK-M
23+
// RUN: -fprebuilt-module-path=%t -o - | FileCheck %s --check-prefix=CHECK-M
2524

2625
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 useM.cpp \
27-
// RUN: -fmodule-file=M=M.pcm -S -emit-llvm -o - \
28-
// RUN: | FileCheck %s --check-prefix=CHECK-USE
26+
// RUN: -fprebuilt-module-path=%t -S -emit-llvm -o - \
27+
// RUN: | FileCheck %s --check-prefix=CHECK-USE
2928

3029
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 M-impl.cpp \
31-
// RUN: -fmodule-file=M=M.pcm -S -emit-llvm -o - \
32-
// RUN: | FileCheck %s --check-prefix=CHECK-IMPL
30+
// RUN: -fprebuilt-module-path=%t -S -emit-llvm -o - \
31+
// RUN: | FileCheck %s --check-prefix=CHECK-IMPL
3332

3433
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 N.cpp -S -emit-llvm \
3534
// RUN: -o - | FileCheck %s --check-prefix=CHECK-N
3635

3736
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 O.cpp -S -emit-llvm \
3837
// RUN: -o - | FileCheck %s --check-prefix=CHECK-O
3938

40-
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 M-part.cpp -S -emit-llvm \
39+
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 M-Part.cpp -S -emit-llvm \
4140
// RUN: -o - | FileCheck %s --check-prefix=CHECK-P
4241

4342
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 M.cpp \
44-
// RUN: -fmodule-file=N.pcm -fmodule-file=O=O.pcm -fmodule-file=M:Part=M-part.pcm \
45-
// RUN: -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-M
43+
// RUN: -fprebuilt-module-path=%t -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-M
4644

4745
//--- N-h.h
4846

@@ -112,7 +110,7 @@ struct Croak {
112110

113111
Croak Frog;
114112

115-
//--- M-part.cpp
113+
//--- M-Part.cpp
116114

117115
module;
118116
#include "P-h.h"

clang/test/CodeGenCXX/partitions.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -triple %itanium_abi_triple %t/parta.cppm -o %t/mod-parta.pcm
66
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -triple %itanium_abi_triple %t/partb.cppm -o %t/mod-partb.pcm
7-
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -triple %itanium_abi_triple -fmodule-file=%t/mod-parta.pcm \
8-
// RUN: -fmodule-file=%t/mod-partb.pcm %t/mod.cppm -o %t/mod.pcm
7+
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -triple %itanium_abi_triple %t/mod.cppm \
8+
// RUN: -fprebuilt-module-path=%t -o %t/mod.pcm
99
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/mod.pcm -S -emit-llvm -disable-llvm-passes -o - \
10-
// RUN: | FileCheck %t/mod.cppm
11-
// RUN: %clang_cc1 -std=c++20 -O2 -emit-module-interface -triple %itanium_abi_triple -fmodule-file=%t/mod-parta.pcm \
12-
// RUN: -fmodule-file=%t/mod-partb.pcm %t/mod.cppm -o %t/mod.pcm
13-
// RUN: %clang_cc1 -std=c++20 -O2 -triple %itanium_abi_triple %t/mod.pcm -S -emit-llvm -disable-llvm-passes -o - \
14-
// RUN: | FileCheck %t/mod.cppm -check-prefix=CHECK-OPT
10+
// RUN: -fprebuilt-module-path=%t | FileCheck %t/mod.cppm
11+
// RUN: %clang_cc1 -std=c++20 -O2 -emit-module-interface -triple %itanium_abi_triple \
12+
// RUN: -fprebuilt-module-path=%t %t/mod.cppm -o %t/mod.pcm
13+
// RUN: %clang_cc1 -std=c++20 -O2 -triple %itanium_abi_triple %t/mod.pcm -S -emit-llvm \
14+
// RUN: -fprebuilt-module-path=%t -disable-llvm-passes -o - | FileCheck %t/mod.cppm -check-prefix=CHECK-OPT
1515

1616
//--- parta.cppm
1717
export module mod:parta;

clang/test/Modules/cxx20-10-1-ex1.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
// RUN: -o %t/A_Internals.pcm
1010

1111
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-1-ex1-tu2.cpp \
12-
// RUN: -fmodule-file=%t/A_Internals.pcm -o %t/A_Foo.pcm
12+
// RUN: -fmodule-file=A:Internals=%t/A_Internals.pcm -o %t/A_Foo.pcm
1313

1414
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-1-ex1-tu3.cpp \
15-
// RUN: -fmodule-file=%t/A_Foo.pcm -o %t/A.pcm
15+
// RUN: -fmodule-file=A:Foo=%t/A_Foo.pcm -fmodule-file=A:Internals=%t/A_Internals.pcm \
16+
// RUN: -o %t/A.pcm
1617

1718
// RUN: %clang_cc1 -std=c++20 -emit-obj %t/std10-1-ex1-tu4.cpp \
18-
// RUN: -fmodule-file=%t/A.pcm -o %t/ex1.o
19+
// RUN: -fmodule-file=A=%t/A.pcm -fmodule-file=A:Foo=%t/A_Foo.pcm \
20+
// RUN: -fmodule-file=A:Internals=%t/A_Internals.pcm -o %t/ex1.o
1921

2022
// expected-no-diagnostics
2123

clang/test/Modules/cxx20-importing-function-bodies.cppm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/c.cppm \
1010
// RUN: -emit-module-interface -fprebuilt-module-path=%t -o %t/c.pcm
1111
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/c.pcm -S \
12-
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %t/c.cppm
12+
// RUN: -fprebuilt-module-path=%t -emit-llvm -disable-llvm-passes -o - \
13+
// RUN: | FileCheck %t/c.cppm
1314
//
1415
// Be sure that we keep the same behavior as if optization not enabled.
1516
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple -O3 %t/a.cppm \
@@ -19,7 +20,8 @@
1920
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple -O3 %t/c.cppm \
2021
// RUN: -emit-module-interface -fprebuilt-module-path=%t -o %t/c.pcm
2122
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple -O3 %t/c.pcm \
22-
// RUN: -S -emit-llvm -disable-llvm-passes -o - | FileCheck %t/c.cppm
23+
// RUN: -fprebuilt-module-path=%t -S -emit-llvm -disable-llvm-passes \
24+
// RUN: -o - | FileCheck %t/c.cppm
2325

2426
//--- a.cppm
2527
export module a;

clang/test/Modules/cxx20-module-file-info.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
// RUN: -o %t/B.pcm
1515

1616
// RUN: %clang_cc1 -std=c++20 -module-file-info %t/B.pcm | FileCheck \
17-
// RUN: --check-prefix=CHECK-B %s
17+
// RUN: --check-prefix=CHECK-B %s
1818

1919
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/mod-info-tu3.cpp \
20-
// RUN: -fmodule-file=%t/A.pcm -fmodule-file=%t/B.pcm -o %t/Foo.pcm
20+
// RUN: -fmodule-file=A=%t/A.pcm -fmodule-file=B=%t/B.pcm -o %t/Foo.pcm
2121

22-
// RUN: %clang_cc1 -std=c++20 -module-file-info %t/Foo.pcm | FileCheck \
23-
// RUN: --check-prefix=CHECK-FOO %s
22+
// RUN: %clang_cc1 -std=c++20 -module-file-info %t/Foo.pcm -fmodule-file=A=%t/A.pcm \
23+
// RUN: -fmodule-file=B=%t/B.pcm | FileCheck \
24+
// RUN: --check-prefix=CHECK-FOO %s
2425

2526
// expected-no-diagnostics
2627

clang/test/Modules/cxx20-partition-redeclarations.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
// RUN: %clang_cc1 -std=c++20 A-interface.cpp -emit-module-interface \
88
// RUN: -fmodule-file=A-PubPart.pcm -o A.pcm
99

10-
// RUN: %clang_cc1 -std=c++20 A-impl-top.cpp -fsyntax-only -fmodule-file=A.pcm
11-
// RUN: %clang_cc1 -std=c++20 A-impl-part.cpp -fsyntax-only -fmodule-file=A.pcm
12-
// RUN: %clang_cc1 -std=c++20 A-impl-1.cpp -fsyntax-only -fmodule-file=A.pcm
13-
// RUN: %clang_cc1 -std=c++20 A-impl-2.cpp -fsyntax-only -fmodule-file=A.pcm
10+
// RUN: %clang_cc1 -std=c++20 A-impl-top.cpp -fsyntax-only -fprebuilt-module-path=%t
11+
// RUN: %clang_cc1 -std=c++20 A-impl-part.cpp -fsyntax-only -fprebuilt-module-path=%t
12+
// RUN: %clang_cc1 -std=c++20 A-impl-1.cpp -fsyntax-only -fprebuilt-module-path=%t
13+
// RUN: %clang_cc1 -std=c++20 A-impl-2.cpp -fsyntax-only -fprebuilt-module-path=%t
1414

1515
//--- A-interface.cpp
1616
export module A;

clang/test/Modules/eagerly-load-cxx-named-modules.cppm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
// RUN: 2>&1 | FileCheck %t/user.cpp
88
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \
99
// RUN: -fprebuilt-module-path=%t
10-
// RUN: %clang_cc1 -std=c++20 %t/b.pcm -Wno-read-modules-implicitly -S \
11-
// RUN: -emit-llvm 2>&1 -o - | FileCheck %t/b.cppm
10+
// RUN: %clang_cc1 -std=c++20 %t/b.pcm -S \
11+
// RUN: -fprebuilt-module-path=%t -emit-llvm 2>&1 -o - | FileCheck %t/b.cppm
1212

1313
//--- a.cppm
1414
export module a;

clang/test/Modules/implicit-module-with-missing-path.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: echo -e "export module B;\nimport C;" >> %t/B.cppm
77
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/subdir/C.cppm -o %t/subdir/C.pcm
88
// RUN: %clang_cc1 -std=c++20 -emit-module-interface -fprebuilt-module-path=%t/subdir %t/B.cppm -o %t/B.pcm
9-
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %s -fsyntax-only -verify -Wno-read-modules-implicitly
9+
// RUN: %clang_cc1 -std=c++20 -fmodule-file=B=%t/B.pcm %s -fsyntax-only -verify
1010

11-
import B;
12-
import C; // expected-error {{module 'C' is needed but has not been provided, and implicit use of module files is disabled}}
11+
import B; // expected-error {{failed to find module file for module 'C'}}
12+
import C; // expected-error {{module 'C' not found}}

clang/test/Modules/module-init-duplicated-import.cppm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.cppm \
88
// RUN: -emit-module-interface -fmodule-file=a=%t/a.pcm -o %t/m.pcm
99
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.pcm \
10-
// RUN: -S -emit-llvm -o - | FileCheck %t/m.cppm
10+
// RUN: -fmodule-file=a=%t/a.pcm -S -emit-llvm -o - | FileCheck %t/m.cppm
1111

1212
//--- a.cppm
1313
export module a;

clang/test/Modules/no-duplicate-codegen-in-GMF.cppm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/A.cppm -emit-module-interface -o %t/A.pcm
88
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/B.cppm -emit-module-interface -o %t/B.pcm \
99
// RUN: -fprebuilt-module-path=%t
10-
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/B.pcm -S -emit-llvm -o - | FileCheck %t/B.cppm
10+
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/B.pcm -S -emit-llvm -o - \
11+
// RUN: -fprebuilt-module-path=%t | FileCheck %t/B.cppm
1112

1213
//--- foo.h
1314

0 commit comments

Comments
 (0)