1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/CodeGen/Generic/fast-math-flags.ll
Qiu Chaofan 71cc6e9751 [LLParser] Delete temp CallInst when error occurs
Only functions with floating-point return type accepts fast-math flags.
When adding such flags to function returning integer, we'll see a crash,
because there's still an undeleted value referencing the argument. This
patch manually removes the temporary instruction when error occurs.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D78355
2020-06-16 11:41:25 +08:00

11 lines
298 B
LLVM

; RUN: not llc < %s 2>&1 | FileCheck %s
; CHECK: error: fast-math-flags specified for call without floating-point scalar or vector return type
define i64 @test_lrintf(float %f) {
entry:
%0 = tail call fast i64 @llvm.lrint.i64.f32(float %f)
ret i64 %0
}
declare i64 @llvm.lrint.i64.f32(float)