[llvm-commits] CVS: llvm/test/Regression/Transforms/SimplifyLibCalls/Pow.ll

Chris Lattner lattner at cs.uiuc.edu
Sat Feb 11 01:37:20 PST 2006



Changes in directory llvm/test/Regression/Transforms/SimplifyLibCalls:

Pow.ll updated: 1.3 -> 1.4
---
Log message:

Update comments to be actually accurate


---
Diffs of the changes:  (+19 -13)

 Pow.ll |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)


Index: llvm/test/Regression/Transforms/SimplifyLibCalls/Pow.ll
diff -u llvm/test/Regression/Transforms/SimplifyLibCalls/Pow.ll:1.3 llvm/test/Regression/Transforms/SimplifyLibCalls/Pow.ll:1.4
--- llvm/test/Regression/Transforms/SimplifyLibCalls/Pow.ll:1.3	Wed Aug 24 12:20:30 2005
+++ llvm/test/Regression/Transforms/SimplifyLibCalls/Pow.ll	Sat Feb 11 03:37:07 2006
@@ -1,17 +1,23 @@
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*pow'
+; Testcase for calls to the standard C "pow" function
+;
+; Equivalent to: http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01786.html
+; RUN: llvm-as < %s | opt -simplify-libcalls -disable-output &&
+; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call double .pow'
 
-declare double %pow(double,double)
-%fpstorage = global double 5.0
+declare double %pow(double, double)
 
-implementation   ; Functions:
+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
+}
 
-int %main () {
-  %fpnum = load double* %fpstorage;
-  %one = call double %pow(double 1.0, double %fpnum)
-  %two = call double %pow(double %one, double 0.5)
-  %three = call double %pow(double %two, double 1.0)
-  %four = call double %pow(double %three, double -1.0)
-  %five = call double %pow(double %four, double 0.0)
-  %result = cast double %five to int
-  ret int %result
+double %test3(double %X) {
+	%Y = call double %pow(double 1.0, double %X)
+	ret double %Y    ; 1.0^x always equals 1.0
 }
+






More information about the llvm-commits mailing list