blob: fa638ef78014ed88209b819bdd44028d9c0b824d [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Testcase for calls to the standard C "pow" function
2;
3; Equivalent to: http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01786.html
Tanya Lattner003eae52008-03-10 07:21:50 +00004; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005; RUN: not grep {call double .pow}
6; END.
7
Tanya Lattner003eae52008-03-10 07:21:50 +00008declare double @pow(double, double)
Dan Gohmanf17a25c2007-07-18 16:29:46 +00009
Tanya Lattner003eae52008-03-10 07:21:50 +000010define double @test1(double %X) {
11 %Y = call double @pow( double %X, double 0.000000e+00 ) ; <double> [#uses=1]
12 ret double %Y
Dan Gohmanf17a25c2007-07-18 16:29:46 +000013}
14
Tanya Lattner003eae52008-03-10 07:21:50 +000015define double @test2(double %X) {
16 %Y = call double @pow( double %X, double -0.000000e+00 ) ; <double> [#uses=1]
17 ret double %Y
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018}
19
Tanya Lattner003eae52008-03-10 07:21:50 +000020define double @test3(double %X) {
21 %Y = call double @pow( double 1.000000e+00, double %X ) ; <double> [#uses=1]
22 ret double %Y
Dan Gohmanf17a25c2007-07-18 16:29:46 +000023}
24