Vasileios Kalintiris | c744e12 | 2015-11-12 15:26:54 +0000 | [diff] [blame] | 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. |
Sumanth Gundapaneni | c27f548 | 2015-12-16 19:09:51 +0000 | [diff] [blame] | 7 | // REQUIRES: mips-registered-target |
Vasileios Kalintiris | c744e12 | 2015-11-12 15:26:54 +0000 | [diff] [blame] | 8 | |
Vasileios Kalintiris | c744e12 | 2015-11-12 15:26:54 +0000 | [diff] [blame] | 9 | // = Big-endian, mips32r2, hard float |
| 10 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
Jonas Hahnfeld | d196fa5 | 2016-07-27 08:15:54 +0000 | [diff] [blame^] | 11 | // RUN: --target=mips-mti-linux -mips32r2 -mhard-float -rtlib=platform \ |
Vasileios Kalintiris | c744e12 | 2015-11-12 15:26:54 +0000 | [diff] [blame] | 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: "-fuse-init-array" "-target-cpu" "mips32r2" |
| 17 | // CHECK-BE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot" |
Rafael Espindola | 156aac0 | 2015-11-16 09:12:12 +0000 | [diff] [blame] | 18 | // CHECK-BE-HF-32R2: "{{[^"]*}}lld{{[^"]*}}" "-flavor" "old-gnu" "-target" "mips-mti-linux" |
Vasileios Kalintiris | c744e12 | 2015-11-12 15:26:54 +0000 | [diff] [blame] | 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" |
NAKAMURA Takumi | 978cbc5 | 2015-11-13 04:44:51 +0000 | [diff] [blame] | 23 | // CHECK-BE-HF-32R2-SAME: "{{[^"]+}}/mips-r2-hard-musl{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-mips.a" |
Vasileios Kalintiris | c744e12 | 2015-11-12 15:26:54 +0000 | [diff] [blame] | 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 \ |
Jonas Hahnfeld | d196fa5 | 2016-07-27 08:15:54 +0000 | [diff] [blame^] | 29 | // RUN: --target=mips-mti-linux -mips32r2 -EL -mhard-float -rtlib=platform \ |
Vasileios Kalintiris | c744e12 | 2015-11-12 15:26:54 +0000 | [diff] [blame] | 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: "-fuse-init-array" "-target-cpu" "mips32r2" |
| 35 | // CHECK-LE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot" |
Rafael Espindola | 156aac0 | 2015-11-16 09:12:12 +0000 | [diff] [blame] | 36 | // CHECK-LE-HF-32R2: "{{[^"]*}}lld{{[^"]*}}" "-flavor" "old-gnu" "-target" "mipsel-mti-linux" |
Vasileios Kalintiris | c744e12 | 2015-11-12 15:26:54 +0000 | [diff] [blame] | 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" |
Vasileios Kalintiris | bbc9930 | 2015-11-16 15:41:30 +0000 | [diff] [blame] | 41 | // CHECK-LE-HF-32R2-SAME: "{{[^"]+}}/mipsel-r2-hard-musl{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-mips.a" |
Vasileios Kalintiris | c744e12 | 2015-11-12 15:26:54 +0000 | [diff] [blame] | 42 | // CHECK-LE-HF-32R2-SAME: "-lc" |
| 43 | // CHECK-LE-HF-32R2-SAME: "[[SYSROOT]]/mipsel-r2-hard-musl/usr/lib{{/|\\\\}}crtn.o" |