1 // Test that -print-library-module-manifest-path finds the correct file.
3 // RUN: rm -rf %t && split-file %s %t && cd %t
4 // RUN: mkdir -p %t/Inputs/usr/lib/x86_64-linux-gnu
5 // RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.so
6 // RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.a
8 // RUN: %clang -print-library-module-manifest-path \
9 // RUN: -stdlib=libc++ \
10 // RUN: -resource-dir=%t/Inputs/usr/lib/x86_64-linux-gnu \
11 // RUN: --target=x86_64-linux-gnu 2>&1 \
12 // RUN: | FileCheck libcxx-no-module-json.cpp
14 // RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.modules.json
15 // RUN: %clang -print-library-module-manifest-path \
16 // RUN: -stdlib=libc++ \
17 // RUN: -resource-dir=%t/Inputs/usr/lib/x86_64-linux-gnu \
18 // RUN: --target=x86_64-linux-gnu 2>&1 \
19 // RUN: | FileCheck libcxx.cpp
21 // RUN: rm %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.so
22 // RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.a
23 // RUN: %clang -print-library-module-manifest-path \
24 // RUN: -stdlib=libc++ \
25 // RUN: -resource-dir=%t/Inputs/usr/lib/x86_64-linux-gnu \
26 // RUN: --target=x86_64-linux-gnu 2>&1 \
27 // RUN: | FileCheck libcxx-no-shared-lib.cpp
29 // RUN: %clang -print-library-module-manifest-path \
30 // RUN: -stdlib=libstdc++ \
31 // RUN: -resource-dir=%t/Inputs/usr/lib/x86_64-linux-gnu \
32 // RUN: --target=x86_64-linux-gnu 2>&1 \
33 // RUN: | FileCheck libstdcxx.cpp
35 //--- libcxx-no-module-json.cpp
37 // CHECK: <NOT PRESENT>
41 // CHECK: {{.*}}/Inputs/usr/lib/x86_64-linux-gnu{{/|\\}}libc++.modules.json
43 //--- libcxx-no-shared-lib.cpp
45 // Note this might find a different path depending whether search path
46 // contains a different libc++.so.
47 // CHECK: {{.*}}libc++.modules.json
51 // CHECK: <NOT PRESENT>