-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "[clang][modules] Print library module manifest path." (#82160)
This implements a way for the compiler to find the modules.json associated with the C++23 Standard library modules. This is based on a discussion in SG15. At the moment no Standard library installs this manifest. #75741 adds this feature in libc++. This reverts commit 82f424f. Disables the tests on non-X86 platforms as suggested.
- Loading branch information
Showing
4 changed files
with
97 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
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
40 changes: 40 additions & 0 deletions
40
clang/test/Driver/modules-print-library-module-manifest-path.cpp
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,40 @@ | ||
// Test that -print-library-module-manifest-path finds the correct file. | ||
|
||
// FIXME: Enable on all platforms. | ||
|
||
// REQUIRES: x86-registered-target | ||
|
||
// RUN: rm -rf %t && split-file %s %t && cd %t | ||
// RUN: mkdir -p %t/Inputs/usr/lib/x86_64-linux-gnu | ||
// RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.so | ||
|
||
// RUN: %clang -print-library-module-manifest-path \ | ||
// RUN: -stdlib=libc++ \ | ||
// RUN: --sysroot=%t/Inputs \ | ||
// RUN: --target=x86_64-linux-gnu 2>&1 \ | ||
// RUN: | FileCheck libcxx-no-module-json.cpp | ||
|
||
// RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/modules.json | ||
// RUN: %clang -print-library-module-manifest-path \ | ||
// RUN: -stdlib=libc++ \ | ||
// RUN: --sysroot=%t/Inputs \ | ||
// RUN: --target=x86_64-linux-gnu 2>&1 \ | ||
// RUN: | FileCheck libcxx.cpp | ||
|
||
// RUN: %clang -print-library-module-manifest-path \ | ||
// RUN: -stdlib=libstdc++ \ | ||
// RUN: --sysroot=%t/Inputs \ | ||
// RUN: --target=x86_64-linux-gnu 2>&1 \ | ||
// RUN: | FileCheck libstdcxx.cpp | ||
|
||
//--- libcxx-no-module-json.cpp | ||
|
||
// CHECK: <NOT PRESENT> | ||
|
||
//--- libcxx.cpp | ||
|
||
// CHECK: {{.*}}/Inputs/usr/lib/x86_64-linux-gnu{{/|\\}}modules.json | ||
|
||
//--- libstdcxx.cpp | ||
|
||
// CHECK: <NOT PRESENT> |