88 lines · cpp
1// Test that -print-library-module-manifest-path finds the correct file.2 3// RUN: rm -rf %t && split-file %s %t && cd %t4// RUN: mkdir -p %t/Inputs/usr/lib/x86_64-linux-gnu5// RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.so6// RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.a7 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.cpp13 14// RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.modules.json15// 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.cpp20 21// check that -nostdlib causes no library-provided module manifest to22// be reported, even when libc++.modules.json is present.23// RUN: %clang -print-library-module-manifest-path \24// RUN: -nostdlib \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-module-json.cpp28 29// for macos there is a different directory structure30// where the library and libc++.modules.json file are in lib31// directly but headers are in clang/ver directory which32// is the resource directory33// RUN: mkdir -p %t/Inputs/usr/lib/clang/2034// RUN: touch %t/Inputs/usr/lib/libc++.so35// RUN: touch %t/Inputs/usr/lib/libc++.modules.json36// RUN: %clang -print-library-module-manifest-path \37// RUN: -stdlib=libc++ \38// RUN: -resource-dir=%t/Inputs/usr/lib/clang/20 \39// RUN: --target=arm64-apple-darwin24.1.0 2>&1 \40// RUN: | FileCheck libcxx.cpp.macos41 42// RUN: rm %t/Inputs/usr/lib/libc++.so43// RUN: touch %t/Inputs/usr/lib/libc++.a44// RUN: touch %t/Inputs/usr/lib/libc++.modules.json45// RUN: %clang -print-library-module-manifest-path \46// RUN: -stdlib=libc++ \47// RUN: -resource-dir=%t/Inputs/usr/lib/clang/20 \48// RUN: --target=arm64-apple-darwin24.1.0 2>&1 \49// RUN: | FileCheck libcxx.cpp.macos50 51// RUN: rm %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.so52// RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.a53// RUN: %clang -print-library-module-manifest-path \54// RUN: -stdlib=libc++ \55// RUN: -resource-dir=%t/Inputs/usr/lib/x86_64-linux-gnu \56// RUN: --target=x86_64-linux-gnu 2>&1 \57// RUN: | FileCheck libcxx-no-shared-lib.cpp58 59// Testing with libstdc++60// RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libstdc++.so61// RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libstdc++.modules.json62// RUN: %clang -print-library-module-manifest-path \63// RUN: -stdlib=libstdc++ \64// RUN: -resource-dir=%t/Inputs/usr/lib/x86_64-linux-gnu \65// RUN: --target=x86_64-linux-gnu 2>&1 \66// RUN: | FileCheck libstdcxx.cpp67 68//--- libcxx-no-module-json.cpp69 70// CHECK: <NOT PRESENT>71 72//--- libcxx.cpp73 74// CHECK: {{.*}}/Inputs/usr/lib/x86_64-linux-gnu{{/|\\}}libc++.modules.json75 76//--- libcxx.cpp.macos77 78// CHECK: {{.*}}libc++.modules.json79 80//--- libcxx-no-shared-lib.cpp81 82// Note this might find a different path depending whether search path83// contains a different libc++.so.84// CHECK: {{.*}}libc++.modules.json85 86//--- libstdcxx.cpp87 88// CHECK: {{.*}}libstdc++.modules.json