1 // RUN: %clang --target=riscv32-unknown-elf %s -### 2>&1 \
2 // RUN: | FileCheck -check-prefix=CHECK-ILP32 %s
3 // RUN: %clang --target=riscv32-unknown-elf %s -### -mabi=ilp32 2>&1 \
4 // RUN: | FileCheck -check-prefix=CHECK-ILP32 %s
5 // RUN: %clang --target=riscv32-unknown-elf %s -### -march=rv32imc 2>&1 \
6 // RUN: | FileCheck -check-prefix=CHECK-ILP32 %s
7 // RUN: %clang --target=riscv32-unknown-elf %s -### -march=rv32imf 2>&1 \
8 // RUN: | FileCheck -check-prefix=CHECK-ILP32 %s
9 // RUN: %clang --target=riscv32-unknown-elf -x assembler %s -### 2>&1 \
10 // RUN: | FileCheck -check-prefix=CHECK-ILP32 %s
11 // RUN: %clang --target=riscv32-unknown-elf -x assembler %s -### \
12 // RUN: -mabi=ilp32 2>&1 | FileCheck -check-prefix=CHECK-ILP32 %s
14 // CHECK-ILP32: "-target-abi" "ilp32"
16 // RUN: %clang --target=riscv32-unknown-elf %s -### -march=rv32e -mabi=ilp32e 2>&1 \
17 // RUN: | FileCheck -check-prefix=CHECK-ILP32E %s
18 // RUN: %clang --target=riscv32-unknown-elf %s -### -mabi=ilp32e 2>&1 \
19 // RUN: | FileCheck -check-prefix=CHECK-ILP32E %s
20 // RUN: %clang --target=riscv32-unknown-elf %s -### -march=rv32e 2>&1 \
21 // RUN: | FileCheck -check-prefix=CHECK-ILP32E %s
23 // CHECK-ILP32E: "-target-abi" "ilp32e"
25 // RUN: %clang --target=riscv32-unknown-elf %s -### -march=rv32if -mabi=ilp32f 2>&1 \
26 // RUN: | FileCheck -check-prefix=CHECK-ILP32F %s
28 // CHECK-ILP32F: "-target-abi" "ilp32f"
30 // RUN: %clang --target=riscv32-unknown-elf %s -### -march=rv32ifd -mabi=ilp32d 2>&1 \
31 // RUN: | FileCheck -check-prefix=CHECK-ILP32D %s
32 // RUN: %clang --target=riscv32-unknown-elf %s -### -march=rv32ifd 2>&1 \
33 // RUN: | FileCheck -check-prefix=CHECK-ILP32D %s
34 // RUN: %clang --target=riscv32-unknown-elf %s -### -march=rv32g 2>&1 \
35 // RUN: | FileCheck -check-prefix=CHECK-ILP32D %s
36 // RUN: %clang --target=riscv32-unknown-linux-gnu %s -### 2>&1 \
37 // RUN: | FileCheck -check-prefix=CHECK-ILP32D %s
38 // RUN: %clang --target=riscv32-unknown-linux-gnu -x assembler %s -### 2>&1 \
39 // RUN: | FileCheck -check-prefix=CHECK-ILP32D %s
41 // CHECK-ILP32D: "-target-abi" "ilp32d"
43 // RUN: not %clang --target=riscv32-unknown-elf %s -o %t.o -mabi=lp64 2>&1 \
44 // RUN: | FileCheck -check-prefix=CHECK-RV32-LP64 %s
46 // CHECK-RV32-LP64: error: unknown target ABI 'lp64'
48 // RUN: %clang --target=riscv64-unknown-elf %s -### 2>&1 \
49 // RUN: | FileCheck -check-prefix=CHECK-LP64 %s
50 // RUN: %clang --target=riscv64-unknown-elf %s -### -mabi=lp64 2>&1 \
51 // RUN: | FileCheck -check-prefix=CHECK-LP64 %s
52 // RUN: %clang --target=riscv64-unknown-elf %s -### -march=rv64imc 2>&1 \
53 // RUN: | FileCheck -check-prefix=CHECK-LP64 %s
54 // RUN: %clang --target=riscv64-unknown-elf %s -### -march=rv64imf 2>&1 \
55 // RUN: | FileCheck -check-prefix=CHECK-LP64 %s
56 // RUN: %clang --target=riscv64-unknown-elf -x assembler %s -### 2>&1 \
57 // RUN: | FileCheck -check-prefix=CHECK-LP64 %s
58 // RUN: %clang --target=riscv64-unknown-elf -x assembler %s -### \
59 // RUN: -mabi=lp64 2>&1 | FileCheck -check-prefix=CHECK-LP64 %s
61 // CHECK-LP64: "-target-abi" "lp64"
63 // RUN: not %clang --target=riscv64-unknown-elf %s -### -march=rv64f -mabi=lp64f 2>&1 \
64 // RUN: | FileCheck -check-prefix=CHECK-LP64F %s
66 // CHECK-LP64F: "-target-abi" "lp64f"
68 // RUN: %clang --target=riscv64-unknown-elf %s -### -march=rv64ifd -mabi=lp64d 2>&1 \
69 // RUN: | FileCheck -check-prefix=CHECK-LP64D %s
70 // RUN: %clang --target=riscv64-unknown-elf %s -### -march=rv64ifd 2>&1 \
71 // RUN: | FileCheck -check-prefix=CHECK-LP64D %s
72 // RUN: %clang --target=riscv64-unknown-elf %s -### -march=rv64g 2>&1 \
73 // RUN: | FileCheck -check-prefix=CHECK-LP64D %s
74 // RUN: %clang --target=riscv64-unknown-linux-gnu %s -### 2>&1 \
75 // RUN: | FileCheck -check-prefix=CHECK-LP64D %s
76 // RUN: %clang --target=riscv64-unknown-linux-gnu -x assembler %s -### 2>&1 \
77 // RUN: | FileCheck -check-prefix=CHECK-LP64D %s
79 // CHECK-LP64D: "-target-abi" "lp64d"
81 // RUN: not %clang --target=riscv64-unknown-elf %s -o %t.o -mabi=ilp32 2>&1 \
82 // RUN: | FileCheck -check-prefix=CHECK-RV64-ILP32 %s
84 // CHECK-RV64-ILP32: error: unknown target ABI 'ilp32'