[RISCV][FMV] Support target_clones (#85786)
[llvm-project.git] / clang / test / Driver / linux-per-target-runtime-dir.c
blob97e746f57eda13da59b0fc715e081389b748d304
1 // RUN: %clangxx -x c++ %s -### -o %t.o 2>&1 \
2 // RUN: --target=x86_64-unknown-linux-gnu \
3 // RUN: -stdlib=libc++ \
4 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
5 // RUN: -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
6 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
7 // RUN: | FileCheck --check-prefix=CHECK-PER-TARGET-RUNTIME %s
8 // CHECK-PER-TARGET-RUNTIME: "-cc1"
9 // CHECK-PER-TARGET-RUNTIME: "-resource-dir" "[[RESDIR:[^"]*]]"
10 // CHECK-PER-TARGET-RUNTIME: "-isysroot" "[[SYSROOT:[^"]+]]"
11 // CHECK-PER-TARGET-RUNTIME: "-internal-isystem" "{{.*}}{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
12 // CHECK-PER-TARGET-RUNTIME: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
13 // CHECK-PER-TARGET-RUNTIME: "--sysroot=[[SYSROOT]]"
14 // CHECK-PER-TARGET-RUNTIME: "-L{{.*}}{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-linux-gnu"
16 // RUN: %clang --target=aarch64-unknown-linux-android21 -print-file-name=libc++.so 2>&1 \
17 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
18 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID21 %s
19 // CHECK-LIBCXX-ANDROID21: ..{{/|\\}}lib{{/|\\}}aarch64-unknown-linux-android{{/|\\}}libc++.so
21 // RUN: %clang --target=aarch64-unknown-linux-android23 -print-file-name=libc++.so 2>&1 \
22 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
23 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID23 %s
24 // CHECK-LIBCXX-ANDROID23: ..{{/|\\}}lib{{/|\\}}aarch64-unknown-linux-android23{{/|\\}}libc++.so
26 // RUN: %clang --target=aarch64-unknown-linux-android26 -print-file-name=libc++.so 2>&1 \
27 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
28 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID23 %s
30 // RUN: %clang --target=aarch64-unknown-linux-android29 -print-file-name=libc++.so 2>&1 \
31 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
32 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID29 %s
33 // CHECK-LIBCXX-ANDROID29: ..{{/|\\}}lib{{/|\\}}aarch64-unknown-linux-android29{{/|\\}}libc++.so
35 // RUN: %clang --target=aarch64-unknown-linux-android31 -print-file-name=libc++.so 2>&1 \
36 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
37 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID29 %s
39 // RUN: %clang --target=aarch64-unknown-linux-android -print-file-name=libc++.so 2>&1 \
40 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
41 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID %s
42 // CHECK-LIBCXX-ANDROID: ..{{/|\\}}lib{{/|\\}}aarch64-unknown-linux-android{{/|\\}}libc++.so
44 // RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
45 // RUN: --target=x86_64-unknown-linux-gnu \
46 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
47 // RUN: | FileCheck --check-prefix=CHECK-CLANGRT-X8664 %s
48 // CHECK-CLANGRT-X8664: lib{{/|\\}}x86_64-unknown-linux-gnu{{/|\\}}libclang_rt.builtins.a
50 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
51 // RUN: --target=x86_64-unknown-linux-gnu \
52 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
53 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-X8664 %s
54 // CHECK-FILE-NAME-X8664: lib{{/|\\}}x86_64-unknown-linux-gnu{{/|\\}}libclang_rt.builtins.a
56 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
57 // RUN: --target=aarch64-unknown-linux-android21 \
58 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
59 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID21 %s
60 // CHECK-FILE-NAME-ANDROID21: lib{{/|\\}}aarch64-unknown-linux-android{{/|\\}}libclang_rt.builtins.a
62 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
63 // RUN: --target=aarch64-unknown-linux-android23 \
64 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
65 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID23 %s
66 // CHECK-FILE-NAME-ANDROID23: lib{{/|\\}}aarch64-unknown-linux-android23{{/|\\}}libclang_rt.builtins.a
68 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
69 // RUN: --target=aarch64-unknown-linux-android26 \
70 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
71 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID23 %s
73 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
74 // RUN: --target=aarch64-unknown-linux-android29 \
75 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
76 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID29 %s
77 // CHECK-FILE-NAME-ANDROID29: lib{{/|\\}}aarch64-unknown-linux-android29{{/|\\}}libclang_rt.builtins.a
79 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
80 // RUN: --target=aarch64-unknown-linux-android31 \
81 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
82 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID29 %s
84 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
85 // RUN: --target=aarch64-unknown-linux-android \
86 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
87 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID %s
88 // CHECK-FILE-NAME-ANDROID: lib{{/|\\}}aarch64-unknown-linux-android{{/|\\}}libclang_rt.builtins.a