[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Driver / mips-mti-linux.c
blobebcbff95a7c0eaf4d338fd21a9e56fd90c0f3ae8
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
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
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"
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
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"