blob: 2b940fdb800b4be890fc1df879b450e610dbc08d [file] [log] [blame]
Reid Spencer6e87ec42007-04-16 17:36:08 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis > %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
Chris Lattnerfdcc0d92006-01-23 05:56:34 +00008; XFAIL: sparc
Chris Lattner16a382d2005-08-24 17:20:30 +00009
10declare double %floor(double)
Chris Lattner4bfe10d2006-01-23 06:24:17 +000011declare double %ceil(double)
12declare double %nearbyint(double)
Chris Lattner16a382d2005-08-24 17:20:30 +000013
Chris Lattner4bfe10d2006-01-23 06:24:17 +000014float %test_floor(float %C) {
Chris Lattner16a382d2005-08-24 17:20:30 +000015 %D = cast float %C to double
16 %E = call double %floor(double %D) ; --> floorf
17 %F = cast double %E to float
18 ret float %F
19}
20
Chris Lattner4bfe10d2006-01-23 06:24:17 +000021float %test_ceil(float %C) {
22 %D = cast float %C to double
23 %E = call double %ceil(double %D) ; --> ceilf
24 %F = cast double %E to float
25 ret float %F
26}
27
28float %test_nearbyint(float %C) {
29 %D = cast float %C to double
30 %E = call double %nearbyint(double %D) ; --> floorf
31 %F = cast double %E to float
32 ret float %F
33}
34