blob: d4b3db0b8c9b63173284e9576a962d4ff738323d [file] [log] [blame]
Vasileios Kalintirisc744e122015-11-12 15:26:54 +00001// Check frontend and linker invocations on GPL-free MIPS toolchain.
2//
3// FIXME: Using --sysroot with this toolchain/triple isn't supported. We use
4// it here to test that we are producing the correct paths/flags.
5// Ideally, we'd like to have an --llvm-toolchain option similar to
6// the --gcc-toolchain one.
7
8// XFAIL: win32, win64
9
10// = Big-endian, mips32r2, hard float
11// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
12// RUN: --target=mips-mti-linux -mips32r2 -mhard-float \
13// RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \
14// RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R2 %s
15//
16// CHECK-BE-HF-32R2: "{{[^"]*}}clang{{[^"]*}}" {{.*}} "-triple" "mips-mti-linux"
17// CHECK-BE-HF-32R2-SAME: "-fuse-init-array" "-target-cpu" "mips32r2"
18// CHECK-BE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot"
19// CHECK-BE-HF-32R2: "{{[^"]*}}lld{{[^"]*}}" "-flavor" "gnu" "-target" "mips-mti-linux"
20// CHECK-BE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mips.so.1"
21// CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib{{/|\\\\}}crt1.o"
22// CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib{{/|\\\\}}crti.o"
23// CHECK-BE-HF-32R2-SAME: "-L[[SYSROOT]]/mips-r2-hard-musl/usr/lib"
24// CHECK-BE-HF-32R2-SAME: "{{[^"]+}}/mips-r2-hard-musl/lib/linux/libclang_rt.builtins-mips.a"
25// CHECK-BE-HF-32R2-SAME: "-lc"
26// CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib{{/|\\\\}}crtn.o"
27
28// = Little-endian, mips32r2, hard float
29// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
30// RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float \
31// RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \
32// RUN: | FileCheck --check-prefix=CHECK-LE-HF-32R2 %s
33//
34// CHECK-LE-HF-32R2: "{{[^"]*}}clang{{[^"]*}}" {{.*}} "-triple" "mipsel-mti-linux"
35// CHECK-LE-HF-32R2-SAME: "-fuse-init-array" "-target-cpu" "mips32r2"
36// CHECK-LE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot"
37// CHECK-LE-HF-32R2: "{{[^"]*}}lld{{[^"]*}}" "-flavor" "gnu" "-target" "mipsel-mti-linux"
38// CHECK-LE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mipsel.so.1"
39// CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crt1.o"
40// CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crti.o"
41// CHECK-LE-HF-32R2-SAME: "-L[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib"
42// CHECK-LE-HF-32R2-SAME: "{{[^"]+}}/mipsel-r2-hard-musl/lib/linux/libclang_rt.builtins-mipsel.a"
43// CHECK-LE-HF-32R2-SAME: "-lc"
44// CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crtn.o"