]> granicus.if.org Git - llvm/commitdiff
New testcase for pow builtin recognition
authorChris Lattner <sabre@nondot.org>
Wed, 5 Mar 2003 22:56:59 +0000 (22:56 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 5 Mar 2003 22:56:59 +0000 (22:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5706 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/pow.ll [new file with mode: 0644]

diff --git a/test/Transforms/InstCombine/pow.ll b/test/Transforms/InstCombine/pow.ll
new file mode 100644 (file)
index 0000000..ca0a98a
--- /dev/null
@@ -0,0 +1,23 @@
+; Testcase for calls to the standard C "pow" function
+; RUN: if as < %s | opt -instcombine | dis | grep 'call double %pow'
+; RUN: then exit 1
+; RUN: else exit 0
+; RUN: fi
+
+declare double %pow(double, double)
+
+double %test1(double %X) {
+       %Y = call double %pow(double %X, double 0.0)
+       ret double %Y    ; x^0.0 always equals 0.0
+}
+
+double %test2(double %X) {
+       %Y = call double %pow(double %X, double -0.0)
+       ret double %Y    ; x^-0.0 always equals 0.0
+}
+
+double %test3(double %X) {
+       %Y = call double %pow(double 1.0, double %X)
+       ret double %Y    ; 1.0^x always equals 1.0
+}
+