2006-12-02 04:23:10 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*floor(' &&
|
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | grep 'call.*floorf('
|
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*ceil(' &&
|
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | grep 'call.*ceilf('
|
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*nearbyint(' &&
|
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | grep 'call.*nearbyintf('
|
2006-01-23 05:56:34 +00:00
|
|
|
; XFAIL: sparc
|
2005-08-24 17:20:30 +00:00
|
|
|
|
|
|
|
declare double %floor(double)
|
2006-01-23 06:24:17 +00:00
|
|
|
declare double %ceil(double)
|
|
|
|
declare double %nearbyint(double)
|
2005-08-24 17:20:30 +00:00
|
|
|
|
2006-01-23 06:24:17 +00:00
|
|
|
float %test_floor(float %C) {
|
2005-08-24 17:20:30 +00:00
|
|
|
%D = cast float %C to double
|
|
|
|
%E = call double %floor(double %D) ; --> floorf
|
|
|
|
%F = cast double %E to float
|
|
|
|
ret float %F
|
|
|
|
}
|
|
|
|
|
2006-01-23 06:24:17 +00:00
|
|
|
float %test_ceil(float %C) {
|
|
|
|
%D = cast float %C to double
|
|
|
|
%E = call double %ceil(double %D) ; --> ceilf
|
|
|
|
%F = cast double %E to float
|
|
|
|
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
|
|
|
|
ret float %F
|
|
|
|
}
|
|
|
|
|