aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Serialization/ForceCheckFileInputTest.cpp
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2024-03-08 10:12:51 +0800
committerGitHub <noreply@github.com>2024-03-08 10:12:51 +0800
commitda00c60dae0040185dc45039c4397f6e746548e9 (patch)
treeb1ac165e76989b55110e67b222c3368715306b37 /clang/unittests/Serialization/ForceCheckFileInputTest.cpp
parentcc34e56b865f1fc9e894b75fc958f09dff0fcdea (diff)
downloadllvm-da00c60dae0040185dc45039c4397f6e746548e9.zip
llvm-da00c60dae0040185dc45039c4397f6e746548e9.tar.gz
llvm-da00c60dae0040185dc45039c4397f6e746548e9.tar.bz2
[C++20] [Modules] Introduce reduced BMI (#75894)
Close https://github.com/llvm/llvm-project/issues/71034 See https://discourse.llvm.org/t/rfc-c-20-modules-introduce-thin-bmi-and-decls-hash/74755 This patch introduces reduced BMI, which doesn't contain the definitions of functions and variables if its definitions won't contribute to the ABI. Testing is a big part of the patch. We want to make sure the reduced BMI contains the same behavior with the existing and relatively stable fatBMI. This is pretty helpful for further reduction. The user interfaces part it left to following patches to ease the reviewing.
Diffstat (limited to 'clang/unittests/Serialization/ForceCheckFileInputTest.cpp')
-rw-r--r--clang/unittests/Serialization/ForceCheckFileInputTest.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/unittests/Serialization/ForceCheckFileInputTest.cpp b/clang/unittests/Serialization/ForceCheckFileInputTest.cpp
index ed0daa4..ad8892b 100644
--- a/clang/unittests/Serialization/ForceCheckFileInputTest.cpp
+++ b/clang/unittests/Serialization/ForceCheckFileInputTest.cpp
@@ -69,9 +69,9 @@ export int aa = 43;
CIOpts.Diags = Diags;
CIOpts.VFS = llvm::vfs::createPhysicalFileSystem();
- const char *Args[] = {
- "clang++", "-std=c++20", "--precompile", "-working-directory",
- TestDir.c_str(), "a.cppm", "-o", BMIPath.c_str()};
+ const char *Args[] = {"clang++", "-std=c++20",
+ "--precompile", "-working-directory",
+ TestDir.c_str(), "a.cppm"};
std::shared_ptr<CompilerInvocation> Invocation =
createInvocation(Args, CIOpts);
EXPECT_TRUE(Invocation);
@@ -88,6 +88,8 @@ export int aa = 43;
Instance.setDiagnostics(Diags.get());
Instance.setInvocation(Invocation);
+ Instance.getFrontendOpts().OutputFile = BMIPath;
+
if (auto VFSWithRemapping = createVFSFromCompilerInvocation(
Instance.getInvocation(), Instance.getDiagnostics(), CIOpts.VFS))
CIOpts.VFS = VFSWithRemapping;
@@ -95,7 +97,7 @@ export int aa = 43;
Instance.getHeaderSearchOpts().ValidateASTInputFilesContent = true;
- GenerateModuleInterfaceAction Action;
+ GenerateReducedModuleInterfaceAction Action;
EXPECT_TRUE(Instance.ExecuteAction(Action));
EXPECT_FALSE(Diags->hasErrorOccurred());
}