1 // 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 // REQUIRES: mips-registered-target
8 
9 // = Big-endian, mips32r2, hard float
10 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
11 // RUN:     --target=mips-mti-linux -mips32r2 -mhard-float -rtlib=platform -fuse-ld=ld \
12 // RUN:     --sysroot=%S/Inputs/mips_mti_linux/sysroot \
13 // RUN:   | FileCheck --check-prefix=CHECK-BE-HF-32R2 %s
14 //
15 // CHECK-BE-HF-32R2: "{{[^"]*}}clang{{[^"]*}}" {{.*}} "-triple" "mips-mti-linux"
16 // CHECK-BE-HF-32R2-SAME: "-target-cpu" "mips32r2"
17 // CHECK-BE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot"
18 // CHECK-BE-HF-32R2: "{{[^"]*}}ld.lld{{[^"]*}}"
19 // CHECK-BE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mips.so.1"
20 // CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib{{/|\\\\}}crt1.o"
21 // CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib{{/|\\\\}}crti.o"
22 // CHECK-BE-HF-32R2-SAME: "-L[[SYSROOT]]/mips-r2-hard-musl/usr/lib"
23 // CHECK-BE-HF-32R2-SAME: "{{[^"]+}}/mips-r2-hard-musl{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-mips.a"
24 // CHECK-BE-HF-32R2-SAME: "-lc"
25 // CHECK-BE-HF-32R2-SAME: "[[SYSROOT]]/mips-r2-hard-musl/usr/lib{{/|\\\\}}crtn.o"
26 
27 // = Little-endian, mips32r2, hard float
28 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
29 // RUN:     --target=mips-mti-linux -mips32r2 -EL -mhard-float -rtlib=platform -fuse-ld=ld \
30 // RUN:     --sysroot=%S/Inputs/mips_mti_linux/sysroot \
31 // RUN:   | FileCheck --check-prefix=CHECK-LE-HF-32R2 %s
32 //
33 // CHECK-LE-HF-32R2: "{{[^"]*}}clang{{[^"]*}}" {{.*}} "-triple" "mipsel-mti-linux"
34 // CHECK-LE-HF-32R2-SAME: "-target-cpu" "mips32r2"
35 // CHECK-LE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot"
36 // CHECK-LE-HF-32R2: "{{[^"]*}}ld.lld{{[^"]*}}"
37 // CHECK-LE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mipsel.so.1"
38 // CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crt1.o"
39 // CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crti.o"
40 // CHECK-LE-HF-32R2-SAME: "-L[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib"
41 // CHECK-LE-HF-32R2-SAME: "{{[^"]+}}/mipsel-r2-hard-musl{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-mips.a"
42 // CHECK-LE-HF-32R2-SAME: "-lc"
43 // CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crtn.o"
44