2006-02-11 09:37:07 +00:00
|
|
|
; Testcase for calls to the standard C "pow" function
|
|
|
|
;
|
|
|
|
; Equivalent to: http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01786.html
|
2007-04-15 05:16:38 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
|
|
|
|
; RUN: not grep {call double .pow}
|
|
|
|
; END.
|
2005-04-29 05:47:05 +00:00
|
|
|
|
2006-02-11 09:37:07 +00:00
|
|
|
declare double %pow(double, double)
|
2005-04-29 05:47:05 +00:00
|
|
|
|
2006-02-11 09:37:07 +00:00
|
|
|
double %test1(double %X) {
|
|
|
|
%Y = call double %pow(double %X, double 0.0)
|
|
|
|
ret double %Y ; x^0.0 always equals 1.0
|
|
|
|
}
|
|
|
|
|
|
|
|
double %test2(double %X) {
|
|
|
|
%Y = call double %pow(double %X, double -0.0)
|
|
|
|
ret double %Y ; x^-0.0 always equals 1.0
|
|
|
|
}
|
2005-04-29 05:47:05 +00:00
|
|
|
|
2006-02-11 09:37:07 +00:00
|
|
|
double %test3(double %X) {
|
|
|
|
%Y = call double %pow(double 1.0, double %X)
|
|
|
|
ret double %Y ; 1.0^x always equals 1.0
|
2005-04-29 05:47:05 +00:00
|
|
|
}
|
2006-02-11 09:37:07 +00:00
|
|
|
|