2012-02-19 09:38:32 +08:00
|
|
|
// Test that gcc-toolchain option is working correctly
|
|
|
|
//
|
2021-03-21 04:24:49 +08:00
|
|
|
/// Without --rtlib=libgcc the driver may pick clang_rt.crtbegin.o if
|
|
|
|
/// -DCLANG_DEFAULT_RTLIB=compiler-rt.
|
2021-03-24 04:32:30 +08:00
|
|
|
// RUN: %clangxx %s -### --target=x86_64-linux-gnu --sysroot= \
|
2021-03-21 04:24:49 +08:00
|
|
|
// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc 2>&1 | \
|
2021-03-21 00:57:05 +08:00
|
|
|
// RUN: FileCheck %s
|
2013-06-20 17:42:40 +08:00
|
|
|
//
|
|
|
|
// Additionally check that the legacy spelling of the flag works.
|
2021-03-24 04:32:30 +08:00
|
|
|
// RUN: %clangxx %s -### --target=x86_64-linux-gnu --sysroot= \
|
2021-08-21 06:24:58 +08:00
|
|
|
// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc 2>&1 | \
|
2021-03-21 00:57:05 +08:00
|
|
|
// RUN: FileCheck %s
|
2012-02-22 05:51:40 +08:00
|
|
|
//
|
|
|
|
// Test for header search toolchain detection.
|
2012-02-19 09:38:32 +08:00
|
|
|
// CHECK: "-internal-isystem"
|
2021-03-21 00:57:05 +08:00
|
|
|
// CHECK: "[[TOOLCHAIN:[^"]+]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8"
|
2012-02-19 09:38:32 +08:00
|
|
|
// CHECK: "-internal-isystem"
|
2021-03-21 00:57:05 +08:00
|
|
|
// CHECK: "[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8"
|
2012-02-19 09:38:32 +08:00
|
|
|
// CHECK: "-internal-isystem"
|
2021-03-21 00:57:05 +08:00
|
|
|
// CHECK: "[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward"
|
2012-02-22 05:51:40 +08:00
|
|
|
//
|
2012-02-22 06:21:50 +08:00
|
|
|
// Test for linker toolchain detection. Note that only the '-L' flags will use
|
|
|
|
// the same precise formatting of the path as the '-internal-system' flags
|
|
|
|
// above, so we just blanket wildcard match the 'crtbegin.o'.
|
2012-02-20 07:09:50 +08:00
|
|
|
// CHECK: "{{[^"]*}}ld{{(.exe)?}}"
|
2021-03-21 00:57:05 +08:00
|
|
|
// CHECK-SAME: "{{[^"]*}}/usr/lib/gcc/x86_64-linux-gnu/4.8{{/|\\\\}}crtbegin.o"
|
|
|
|
// CHECK-SAME: "-L[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8"
|
|
|
|
/// On x86_64, there is an extra usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu but we should not test it.
|
2021-03-20 06:42:18 +08:00
|
|
|
|
|
|
|
/// Test we don't detect GCC installation under -B.
|
2021-03-24 04:32:30 +08:00
|
|
|
// RUN: %clangxx %s -### --sysroot= 2>&1 \
|
2021-03-20 06:42:18 +08:00
|
|
|
// RUN: --target=aarch64-suse-linux --gcc-toolchain=%S/Inputs/opensuse_42.2_aarch64_tree/usr | \
|
|
|
|
// RUN: FileCheck %s --check-prefix=AARCH64
|
2021-03-24 04:32:30 +08:00
|
|
|
// RUN: %clangxx %s -### --sysroot= 2>&1 \
|
2021-03-20 06:42:18 +08:00
|
|
|
// RUN: --target=aarch64-suse-linux -B%S/Inputs/opensuse_42.2_aarch64_tree/usr | \
|
|
|
|
// RUN: FileCheck %s --check-prefix=NO_AARCH64
|
|
|
|
|
|
|
|
// AARCH64: Inputs{{[^"]+}}aarch64-suse-linux/{{[^"]+}}crt1.o"
|
|
|
|
// NO_AARCH64-NOT: Inputs{{[^"]+}}aarch64-suse-linux/{{[^"]+}}crt1.o"
|