Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Driver / linux-per-target-runtime-dir.c
blob8c721d82821f6adb894fc7cb74b329eb302e803b
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: --gcc-toolchain="" \
7 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
8 // RUN: | FileCheck --check-prefix=CHECK-PER-TARGET-RUNTIME %s
9 // CHECK-PER-TARGET-RUNTIME: "-cc1"
10 // CHECK-PER-TARGET-RUNTIME: "-resource-dir" "[[RESDIR:[^"]*]]"
11 // CHECK-PER-TARGET-RUNTIME: "-isysroot" "[[SYSROOT:[^"]+]]"
12 // CHECK-PER-TARGET-RUNTIME: "-internal-isystem" "{{.*}}{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
13 // CHECK-PER-TARGET-RUNTIME: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
14 // CHECK-PER-TARGET-RUNTIME: "--sysroot=[[SYSROOT]]"
15 // CHECK-PER-TARGET-RUNTIME: "-L{{.*}}{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-linux-gnu"
17 // RUN: %clang --target=aarch64-unknown-linux-android21 -print-file-name=libc++.so 2>&1 \
18 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
19 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID21 %s
20 // CHECK-LIBCXX-ANDROID21: ..{{/|\\}}lib{{/|\\}}aarch64-unknown-linux-android{{/|\\}}libc++.so
22 // RUN: %clang --target=aarch64-unknown-linux-android23 -print-file-name=libc++.so 2>&1 \
23 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
24 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID23 %s
25 // CHECK-LIBCXX-ANDROID23: ..{{/|\\}}lib{{/|\\}}aarch64-unknown-linux-android23{{/|\\}}libc++.so
27 // RUN: %clang --target=aarch64-unknown-linux-android26 -print-file-name=libc++.so 2>&1 \
28 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
29 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID23 %s
31 // RUN: %clang --target=aarch64-unknown-linux-android29 -print-file-name=libc++.so 2>&1 \
32 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
33 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID29 %s
34 // CHECK-LIBCXX-ANDROID29: ..{{/|\\}}lib{{/|\\}}aarch64-unknown-linux-android29{{/|\\}}libc++.so
36 // RUN: %clang --target=aarch64-unknown-linux-android31 -print-file-name=libc++.so 2>&1 \
37 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
38 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID29 %s
40 // RUN: %clang --target=aarch64-unknown-linux-android -print-file-name=libc++.so 2>&1 \
41 // RUN: -ccc-install-dir %S/Inputs/basic_android_libcxx_tree/usr/bin \
42 // RUN: | FileCheck --check-prefix=CHECK-LIBCXX-ANDROID %s
43 // CHECK-LIBCXX-ANDROID: ..{{/|\\}}lib{{/|\\}}aarch64-unknown-linux-android{{/|\\}}libc++.so
45 // RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
46 // RUN: --target=x86_64-unknown-linux-gnu \
47 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
48 // RUN: | FileCheck --check-prefix=CHECK-CLANGRT-X8664 %s
49 // CHECK-CLANGRT-X8664: lib{{/|\\}}x86_64-unknown-linux-gnu{{/|\\}}libclang_rt.builtins.a
51 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
52 // RUN: --target=x86_64-unknown-linux-gnu \
53 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
54 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-X8664 %s
55 // CHECK-FILE-NAME-X8664: lib{{/|\\}}x86_64-unknown-linux-gnu{{/|\\}}libclang_rt.builtins.a
57 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
58 // RUN: --target=aarch64-unknown-linux-android21 \
59 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
60 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID21 %s
61 // CHECK-FILE-NAME-ANDROID21: lib{{/|\\}}aarch64-unknown-linux-android{{/|\\}}libclang_rt.builtins.a
63 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
64 // RUN: --target=aarch64-unknown-linux-android23 \
65 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
66 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID23 %s
67 // CHECK-FILE-NAME-ANDROID23: lib{{/|\\}}aarch64-unknown-linux-android23{{/|\\}}libclang_rt.builtins.a
69 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
70 // RUN: --target=aarch64-unknown-linux-android26 \
71 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
72 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID23 %s
74 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
75 // RUN: --target=aarch64-unknown-linux-android29 \
76 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
77 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID29 %s
78 // CHECK-FILE-NAME-ANDROID29: lib{{/|\\}}aarch64-unknown-linux-android29{{/|\\}}libclang_rt.builtins.a
80 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
81 // RUN: --target=aarch64-unknown-linux-android31 \
82 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
83 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID29 %s
85 // RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 \
86 // RUN: --target=aarch64-unknown-linux-android \
87 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
88 // RUN: | FileCheck --check-prefix=CHECK-FILE-NAME-ANDROID %s
89 // CHECK-FILE-NAME-ANDROID: lib{{/|\\}}aarch64-unknown-linux-android{{/|\\}}libclang_rt.builtins.a