Zakk Chen | 1256d68 | 2020-01-15 06:41:08 -0800 | [diff] [blame] | 1 | ; RUN: llc -mtriple=riscv32 < %s 2>&1 \ |
| 2 | ; RUN: | FileCheck -check-prefix=DEFAULT %s |
| 3 | ; RUN: llc -mtriple=riscv32 -target-abi ilp32 < %s 2>&1 \ |
| 4 | ; RUN: | FileCheck -check-prefix=RV32IF-ILP32 %s |
Yuanfang Chen | 4ad7685 | 2020-02-11 23:01:35 -0800 | [diff] [blame] | 5 | ; RUN: not --crash llc -mtriple=riscv32 -target-abi ilp32f < %s 2>&1 \ |
Zakk Chen | 1256d68 | 2020-01-15 06:41:08 -0800 | [diff] [blame] | 6 | ; RUN: | FileCheck -check-prefix=RV32IF-ILP32F %s |
| 7 | ; RUN: llc -mtriple=riscv32 -filetype=obj < %s | llvm-readelf -h - | FileCheck -check-prefixes=FLAGS %s |
| 8 | |
| 9 | ; RV32IF-ILP32F: -target-abi option != target-abi module flag |
| 10 | |
| 11 | ; FLAGS: Flags: 0x0 |
| 12 | |
| 13 | define float @foo(i32 %a) nounwind #0 { |
| 14 | ; DEFAULT: # %bb.0: |
| 15 | ; DEFAULT: fmv.x.w a0, ft0 |
| 16 | ; RV32IF-ILP32: # %bb.0: |
| 17 | ; RV32IF-ILP32: fmv.x.w a0, ft0 |
| 18 | %conv = sitofp i32 %a to float |
| 19 | ret float %conv |
| 20 | } |
| 21 | |
| 22 | attributes #0 = { "target-features"="+f"} |
| 23 | !llvm.module.flags = !{!0} |
| 24 | !0 = !{i32 1, !"target-abi", !"ilp32"} |