llvm-mirror/test/Transforms/InstCombine/constant-fold-libfunc.ll
Kevin P. Neal a24a01e0c1 [FPEnv] Strict FP tests should use the requisite function attributes.
A set of function attributes is required in any function that uses constrained
floating point intrinsics. None of our tests use these attributes.

This patch fixes this.

These tests have been tested against the IR verifier changes in D68233.

Reviewed by:	andrew.w.kaylor, cameron.mcinally, uweigand
Approved by:	andrew.w.kaylor
Differential Revision:	https://reviews.llvm.org/D67925

llvm-svn: 373761
2019-10-04 17:03:46 +00:00

32 lines
905 B
LLVM

; RUN: opt < %s -instcombine -S | FileCheck %s
declare double @acos(double)
; Check that functions without any function attributes are simplified.
define double @test_simplify_acos() {
; CHECK-LABEL: @test_simplify_acos
%pi = call double @acos(double -1.000000e+00)
; CHECK-NOT: call double @acos
; CHECK: ret double 0x400921FB54442D18
ret double %pi
}
; Check that we don't constant fold builtin functions.
define double @test_acos_nobuiltin() {
; CHECK-LABEL: @test_acos_nobuiltin
%pi = call double @acos(double -1.000000e+00) nobuiltin
; CHECK: call double @acos(double -1.000000e+00)
ret double %pi
}
; Check that we don't constant fold strictfp results that require rounding.
define double @test_acos_strictfp() strictfp {
; CHECK-LABEL: @test_acos_strictfp
%pi = call double @acos(double -1.000000e+00) strictfp
; CHECK: call double @acos(double -1.000000e+00)
ret double %pi
}