diff options
Diffstat (limited to 'test/Transforms/SimplifyLibCalls/floor.ll')
-rw-r--r-- | test/Transforms/SimplifyLibCalls/floor.ll | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/test/Transforms/SimplifyLibCalls/floor.ll b/test/Transforms/SimplifyLibCalls/floor.ll index 2b940fd..9e9b154 100644 --- a/test/Transforms/SimplifyLibCalls/floor.ll +++ b/test/Transforms/SimplifyLibCalls/floor.ll @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis > %t +; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis > %t ; RUN: not grep {call.*floor(} %t ; RUN: grep {call.*floorf(} %t ; RUN: not grep {call.*ceil(} %t @@ -7,28 +7,33 @@ ; RUN: grep {call.*nearbyintf(} %t ; XFAIL: sparc -declare double %floor(double) -declare double %ceil(double) -declare double %nearbyint(double) +declare double @floor(double) -float %test_floor(float %C) { - %D = cast float %C to double - %E = call double %floor(double %D) ; --> floorf - %F = cast double %E to float +declare double @ceil(double) + +declare double @nearbyint(double) + +define float @test_floor(float %C) { + %D = fpext float %C to double ; <double> [#uses=1] + ; --> floorf + %E = call double @floor( double %D ) ; <double> [#uses=1] + %F = fptrunc double %E to float ; <float> [#uses=1] ret float %F } -float %test_ceil(float %C) { - %D = cast float %C to double - %E = call double %ceil(double %D) ; --> ceilf - %F = cast double %E to float +define float @test_ceil(float %C) { + %D = fpext float %C to double ; <double> [#uses=1] + ; --> ceilf + %E = call double @ceil( double %D ) ; <double> [#uses=1] + %F = fptrunc double %E to float ; <float> [#uses=1] ret float %F } -float %test_nearbyint(float %C) { - %D = cast float %C to double - %E = call double %nearbyint(double %D) ; --> floorf - %F = cast double %E to float +define float @test_nearbyint(float %C) { + %D = fpext float %C to double ; <double> [#uses=1] + ; --> floorf + %E = call double @nearbyint( double %D ) ; <double> [#uses=1] + %F = fptrunc double %E to float ; <float> [#uses=1] ret float %F } |