blob: 3b9e48c68e30223145a9afb1ba0af0aa7e7a4e04 [file] [log] [blame]
Chris Lattner539c3372006-02-11 09:37:07 +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
4; RUN: llvm-as < %s | opt -simplify-libcalls -disable-output &&
5; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call double .pow'
Reid Spencer0f4a8912005-04-29 05:47:05 +00006
Chris Lattner539c3372006-02-11 09:37:07 +00007declare double %pow(double, double)
Reid Spencer0f4a8912005-04-29 05:47:05 +00008
Chris Lattner539c3372006-02-11 09:37:07 +00009double %test1(double %X) {
10 %Y = call double %pow(double %X, double 0.0)
11 ret double %Y ; x^0.0 always equals 1.0
Reid Spencer0f4a8912005-04-29 05:47:05 +000012}
Chris Lattner539c3372006-02-11 09:37:07 +000013
14double %test2(double %X) {
15 %Y = call double %pow(double %X, double -0.0)
16 ret double %Y ; x^-0.0 always equals 1.0
17}
18
19double %test3(double %X) {
20 %Y = call double %pow(double 1.0, double %X)
21 ret double %Y ; 1.0^x always equals 1.0
22}
23