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 8 // = Big-endian, mips32r2, hard float 9 // RUN: %clang -### -no-canonical-prefixes %s 2>&1 \ 10 // RUN: --target=mips-mti-linux -mips32r2 -mhard-float -no-pie \ 11 // RUN: -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 2>&1 \ 29 // RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float -no-pie \ 30 // RUN: -rtlib=platform -fuse-ld=ld \ 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: "-target-cpu" "mips32r2" 36 // CHECK-LE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot" 37 // CHECK-LE-HF-32R2: "{{[^"]*}}ld.lld{{[^"]*}}" 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-mips.a" 43 // CHECK-LE-HF-32R2-SAME: "-lc" 44 // CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crtn.o" 45