1 // Check gnutools are invoked with propagated values for -mabi and -march.
3 // This test also checks the default -march/-mabi for certain targets.
7 // Check default on riscv32-unknown-elf
8 // RUN: %clang --target=riscv32-unknown-elf --gcc-toolchain=%S/Inputs/basic_riscv32_tree -fno-integrated-as %s -### -c \
9 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32IMAC-ILP32 %s
11 // Check default on riscv32-unknown-linux-gnu
12 // RUN: %clang --target=riscv32-unknown-linux-gnu --gcc-toolchain=%S/Inputs/basic_riscv32_tree -fno-integrated-as %s -### -c \
13 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32IMAFDC-ILP32D %s
15 // Check default when -march=rv32g specified
16 // RUN: %clang --target=riscv32-unknown-elf --gcc-toolchain=%S/Inputs/basic_riscv32_tree -fno-integrated-as %s -### -c -march=rv32g \
17 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32G-ILP32D %s
19 // Check -mno-relax is passed when -fno-integrated-as specified
20 // RUN: %clang -target riscv32-unknown-elf --gcc-toolchain=%S/Inputs/basic_riscv32_tree -mno-relax -fno-integrated-as %s -### -c \
21 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32-NO-RELAX %s
23 // CHECK-RV32IMAC-ILP32: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32" "-march" "rv32imac"
24 // CHECK-RV32IMAFDC-ILP32D: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32d" "-march" "rv32imafdc"
25 // CHECK-RV32G-ILP32D: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32d" "-march" "rv32g"
26 // CHECK-RV32-NO-RELAX: "{{.*}}as{{(.exe)?}}" "{{.*}}" "-mno-relax"
31 // Check default on riscv64-unknown-elf
32 // RUN: %clang --target=riscv64-unknown-elf --gcc-toolchain=%S/Inputs/basic_riscv64_tree -fno-integrated-as %s -### -c \
33 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64IMAC-LP64 %s
35 // Check default on riscv64-unknown-linux-gnu
36 // RUN: %clang --target=riscv64-unknown-linux-gnu --gcc-toolchain=%S/Inputs/basic_riscv64_tree -fno-integrated-as %s -### -c \
37 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64IMAFDC-LP64D %s
39 // Check default when -march=rv64g specified
40 // RUN: %clang --target=riscv64-unknown-elf --gcc-toolchain=%S/Inputs/basic_riscv64_tree -fno-integrated-as %s -### -c -march=rv64g \
41 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64G-LP64D %s
43 // Check -mno-relax is not passed when -fno-integrated-as specified
44 // RUN: %clang -target riscv64-unknown-elf --gcc-toolchain=%S/Inputs/basic_riscv64_tree -mno-relax -mrelax -fno-integrated-as %s -### -c \
45 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64-RELAX %s
47 // CHECK-RV64IMAC-LP64: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64" "-march" "rv64imac"
48 // CHECK-RV64IMAFDC-LP64D: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64d" "-march" "rv64imafdc"
49 // CHECK-RV64G-LP64D: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64d" "-march" "rv64g"
50 // CHECK-RV64-RELAX: "{{.*}}as{{(.exe)?}}"
51 // CHECK-RV64-RELAX-NOT: "-mno-relax"