aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-11 09:37:07 +0000
committerChris Lattner <sabre@nondot.org>2006-02-11 09:37:07 +0000
commit539c3371483bd62fc01bedc7f7977e39e356ef32 (patch)
tree3e54f35aca6c21e6c5d856437f4fbfc7430df28b /test
parent92aa95fc76e51e4293f4b372e5508ab1f36dead5 (diff)
downloadexternal_llvm-539c3371483bd62fc01bedc7f7977e39e356ef32.zip
external_llvm-539c3371483bd62fc01bedc7f7977e39e356ef32.tar.gz
external_llvm-539c3371483bd62fc01bedc7f7977e39e356ef32.tar.bz2
Update comments to be actually accurate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26124 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/SimplifyLibCalls/Pow.ll32
1 files changed, 19 insertions, 13 deletions
diff --git a/test/Transforms/SimplifyLibCalls/Pow.ll b/test/Transforms/SimplifyLibCalls/Pow.ll
index 4b10ed0..3b9e48c 100644
--- a/test/Transforms/SimplifyLibCalls/Pow.ll
+++ b/test/Transforms/SimplifyLibCalls/Pow.ll
@@ -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
}
+