1 ; RUN: opt < %s -simplify-libcalls -S > %t
2 ; RUN: not grep {call.*floor(} %t
3 ; RUN: grep {call.*floorf(} %t
4 ; RUN: not grep {call.*ceil(} %t
5 ; RUN: grep {call.*ceilf(} %t
6 ; RUN: not grep {call.*nearbyint(} %t
7 ; RUN: grep {call.*nearbyintf(} %t
10 declare double @floor(double)
12 declare double @ceil(double)
14 declare double @nearbyint(double)
16 define float @test_floor(float %C) {
17 %D = fpext float %C to double ; <double> [#uses=1]
19 %E = call double @floor( double %D ) ; <double> [#uses=1]
20 %F = fptrunc double %E to float ; <float> [#uses=1]
24 define float @test_ceil(float %C) {
25 %D = fpext float %C to double ; <double> [#uses=1]
27 %E = call double @ceil( double %D ) ; <double> [#uses=1]
28 %F = fptrunc double %E to float ; <float> [#uses=1]
32 define float @test_nearbyint(float %C) {
33 %D = fpext float %C to double ; <double> [#uses=1]
35 %E = call double @nearbyint( double %D ) ; <double> [#uses=1]
36 %F = fptrunc double %E to float ; <float> [#uses=1]