summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/RISCV
diff options
context:
space:
mode:
authorZakk Chen <zakk.chen@sifive.com>2019-11-28 18:00:54 -0800
committerZakk Chen <zakk.chen@sifive.com>2020-01-15 02:30:43 -0800
commit109e4d12edda07bdec139de36d9fdb6f73399f92 (patch)
treeb8e8f9bbb63e3c3572ae3d9ed213ad7aa97b827d /llvm/test/CodeGen/RISCV
parent2142e20f50954b9b5085e9b9461efc318a3348c0 (diff)
downloadbcm5719-llvm-109e4d12edda07bdec139de36d9fdb6f73399f92.tar.gz
bcm5719-llvm-109e4d12edda07bdec139de36d9fdb6f73399f92.zip
[RISCV] Support ABI checking with per function target-features
if users don't specific -mattr, the default target-feature come from IR attribute.
Diffstat (limited to 'llvm/test/CodeGen/RISCV')
-rw-r--r--llvm/test/CodeGen/RISCV/subtarget-features-std-ext.ll11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/RISCV/subtarget-features-std-ext.ll b/llvm/test/CodeGen/RISCV/subtarget-features-std-ext.ll
index 8ed465ae85f..613a983f926 100644
--- a/llvm/test/CodeGen/RISCV/subtarget-features-std-ext.ll
+++ b/llvm/test/CodeGen/RISCV/subtarget-features-std-ext.ll
@@ -2,12 +2,17 @@
; RUN: | FileCheck -check-prefix=RV32IF-ILP32 %s
; RUN: llc -mtriple=riscv32 -target-abi ilp32f < %s 2>&1 \
; RUN: | FileCheck -check-prefix=RV32IF-ILP32F %s
+; RUN: llc -mtriple=riscv32 -mattr=-f -target-abi ilp32f <%s 2>&1 \
+; RUN: | FileCheck -check-prefix=RV32I-ILP32F-FAILED %s
+
+; RV32I-ILP32F-FAILED: Hard-float 'f' ABI can't be used for a target that doesn't support the F instruction set extension
-; RV32IF-ILP32F: Hard-float 'f' ABI can't be used for a target that doesn't support the F instruction set extension (ignoring target-abi)
define float @foo(i32 %a) nounwind #0 {
-; RV32IF-ILP32: # %bb.0:
-; RV32IF-ILP32-NEXT: fcvt.s.w ft0, a0
+; RV32IF-ILP32: fcvt.s.w ft0, a0
+; RV32IF-ILP32-NEXT: fmv.x.w a0, ft0
+; RV32IF-ILP32F: fcvt.s.w fa0, a0
+; RV32IF-ILP32F-NEXT: ret
%conv = sitofp i32 %a to float
ret float %conv
}
OpenPOWER on IntegriCloud