forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C++20] [Modules] Skip calls to module initializer to modules if we k…
…now the module doesn't init anything Close llvm#97244 This is an optimization allowed by the modules's ABI to skip calls to imported modules for which we know nothing will be initialized.
- Loading branch information
1 parent
91c0ef6
commit 7ee421d
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// REQUIRES: !system-windows | ||
// | ||
// RUN: rm -rf %t | ||
// RUN: mkdir -p %t | ||
// RUN: split-file %s %t | ||
// | ||
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/Empty.cppm \ | ||
// RUN: -emit-module-interface -o %t/Empty.pcm | ||
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/Empty2.cppm \ | ||
// RUN: -fprebuilt-module-path=%t -emit-module-interface -o %t/Empty2.pcm | ||
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/main.cpp \ | ||
// RUN: -fprebuilt-module-path=%t -emit-llvm -o - | FileCheck %t/main.cpp | ||
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/Empty2.pcm \ | ||
// RUN: -fprebuilt-module-path=%t -emit-llvm -o - | FileCheck %t/Empty2.cppm | ||
|
||
//--- Empty.cppm | ||
export module Empty; | ||
|
||
//--- Empty2.cppm | ||
export module Empty2; | ||
import Empty; | ||
|
||
// CHECK-NOT: _ZGIW5Empty | ||
|
||
//--- main.cpp | ||
import Empty; | ||
import Empty2; | ||
|
||
// CHECK-NOT: _ZGIW5Empty | ||
// CHECK-NOT: _ZGIW6Empty2 |