blob: f8364f740b2285346bb842478320bd17580b3107 [file] [log] [blame]
Chris Lattnerf3ed0342006-02-11 09:37:07 +00001; Testcase for calls to the standard C "pow" function
2;
Dan Gohman18800922009-09-11 18:01:28 +00003; RUN: opt < %s -simplify-libcalls -S | not grep {call .pow}
Chris Lattnerb859fb42008-04-09 00:07:45 +00004
Reid Spencera8b88942005-04-29 05:47:05 +00005
Tanya Lattner5f4b3552008-03-10 07:21:50 +00006declare double @pow(double, double)
Chris Lattnerb859fb42008-04-09 00:07:45 +00007declare float @powf(float, float)
Reid Spencera8b88942005-04-29 05:47:05 +00008
Tanya Lattner5f4b3552008-03-10 07:21:50 +00009define double @test1(double %X) {
10 %Y = call double @pow( double %X, double 0.000000e+00 ) ; <double> [#uses=1]
11 ret double %Y
Reid Spencera8b88942005-04-29 05:47:05 +000012}
Chris Lattnerf3ed0342006-02-11 09:37:07 +000013
Tanya Lattner5f4b3552008-03-10 07:21:50 +000014define double @test2(double %X) {
15 %Y = call double @pow( double %X, double -0.000000e+00 ) ; <double> [#uses=1]
16 ret double %Y
Chris Lattnerf3ed0342006-02-11 09:37:07 +000017}
18
Tanya Lattner5f4b3552008-03-10 07:21:50 +000019define double @test3(double %X) {
20 %Y = call double @pow( double 1.000000e+00, double %X ) ; <double> [#uses=1]
21 ret double %Y
Chris Lattnerf3ed0342006-02-11 09:37:07 +000022}
23
Chris Lattnerb859fb42008-04-09 00:07:45 +000024define double @test4(double %X) {
25 %Y = call double @pow( double %X, double 2.0)
26 ret double %Y
27}
28
29define float @test4f(float %X) {
30 %Y = call float @powf( float %X, float 2.0)
31 ret float %Y
32}
Chris Lattner802134f2008-04-09 17:48:11 +000033
34define float @test5f(float %X) {
35 %Y = call float @powf(float 2.0, float %X) ;; exp2
36 ret float %Y
37}