2008-03-10 07:21:50 +00:00
|
|
|
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis > %t
|
2007-04-16 17:36:08 +00:00
|
|
|
; RUN: not grep {call.*floor(} %t
|
|
|
|
; RUN: grep {call.*floorf(} %t
|
|
|
|
; RUN: not grep {call.*ceil(} %t
|
|
|
|
; RUN: grep {call.*ceilf(} %t
|
|
|
|
; RUN: not grep {call.*nearbyint(} %t
|
|
|
|
; RUN: grep {call.*nearbyintf(} %t
|
2006-01-23 05:56:34 +00:00
|
|
|
; XFAIL: sparc
|
2005-08-24 17:20:30 +00:00
|
|
|
|
2008-03-10 07:21:50 +00:00
|
|
|
declare double @floor(double)
|
2005-08-24 17:20:30 +00:00
|
|
|
|
2008-03-10 07:21:50 +00:00
|
|
|
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]
|
2005-08-24 17:20:30 +00:00
|
|
|
ret float %F
|
|
|
|
}
|
|
|
|
|
2008-03-10 07:21:50 +00:00
|
|
|
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]
|
2006-01-23 06:24:17 +00:00
|
|
|
ret float %F
|
|
|
|
}
|
|
|
|
|
2008-03-10 07:21:50 +00:00
|
|
|
define float @test_nearbyint(float %C) {
|
|
|
|
%D = fpext float %C to double ; <double> [#uses=1]
|
2008-05-01 06:16:48 +00:00
|
|
|
; --> nearbyintf
|
2008-03-10 07:21:50 +00:00
|
|
|
%E = call double @nearbyint( double %D ) ; <double> [#uses=1]
|
|
|
|
%F = fptrunc double %E to float ; <float> [#uses=1]
|
2006-01-23 06:24:17 +00:00
|
|
|
ret float %F
|
|
|
|
}
|
|
|
|
|