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 -### %s 2>&1 \ 11 // RUN: --target=mips-mti-linux -mips32r2 -mhard-float -no-pie \ 12 // RUN: -rtlib=platform -fuse-ld=ld \ 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: "-target-cpu" "mips32r2" 18 // CHECK-BE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot" 19 // CHECK-BE-HF-32R2: "{{[^"]*}}ld.lld{{[^"]*}}" 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 -### %s 2>&1 \ 30 // RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float -no-pie \ 31 // RUN: -rtlib=platform -fuse-ld=ld \ 32 // RUN: --sysroot=%S/Inputs/mips_mti_linux/sysroot \ 33 // RUN: | FileCheck --check-prefix=CHECK-LE-HF-32R2 %s 34 // 35 // CHECK-LE-HF-32R2: "{{[^"]*}}clang{{[^"]*}}" {{.*}} "-triple" "mipsel-mti-linux" 36 // CHECK-LE-HF-32R2-SAME: "-target-cpu" "mips32r2" 37 // CHECK-LE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot" 38 // CHECK-LE-HF-32R2: "{{[^"]*}}ld.lld{{[^"]*}}" 39 // CHECK-LE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mipsel.so.1" 40 // CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crt1.o" 41 // CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crti.o" 42 // CHECK-LE-HF-32R2-SAME: "-L[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib" 43 // CHECK-LE-HF-32R2-SAME: "{{[^"]+}}/mipsel-r2-hard-musl{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-mips.a" 44 // CHECK-LE-HF-32R2-SAME: "-lc" 45 // CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crtn.o" 46