1 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
2 // RUN:     -target x86_64-linux-musl -stdlib=libc++ \
3 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
4 // RUN:     -resource-dir=%S/Inputs/resource_dir \
5 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \
6 // RUN:   | FileCheck --check-prefix=CHECK-X86-64-LIBCXX %s
7 
8 // RESOURCE_DIR/include comes after /usr/include on linux-musl.
9 // This is different from a glibc-based distribution.
10 // CHECK-X86-64-LIBCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
11 // CHECK-X86-64-LIBCXX: "-isysroot" "[[SYSROOT:[^"]+]]"
12 // CHECK-X86-64-LIBCXX: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"
13 // CHECK-X86-64-LIBCXX: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
14 // CHECK-X86-64-LIBCXX: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
15 // CHECK-X86-64-LIBCXX: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
16 
17 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only -nobuiltininc 2>&1 \
18 // RUN:     -target x86_64-linux-musl \
19 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
20 // RUN:     -resource-dir=%S/Inputs/resource_dir \
21 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \
22 // RUN:   | FileCheck --check-prefix=CHECK-NOBUILTININC %s
23 
24 // CHECK-NOBUILTININC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
25 // CHECK-NOBUILTININC-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
26 
27 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only -nostdlibinc 2>&1 \
28 // RUN:     -target x86_64-linux-musl \
29 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
30 // RUN:     -resource-dir=%S/Inputs/resource_dir \
31 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \
32 // RUN:   | FileCheck --check-prefix=CHECK-NOSTDLIBINC %s
33 
34 // CHECK-NOSTDLIBINC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
35 // CHECK-NOSTDLIBINC-NOT: "-internal-externc-isystem"
36 // CHECK-NOSTDLIBINC-NOT: "-internal-isystem"
37 // CHECK-NOSTDLIBINC: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
38 // CHECK-NOSTDLIBINC-NOT: "-internal-externc-isystem"
39 // CHECK-NOSTDLIBINC-NOT: "-internal-isystem"
40