It's not necessary to do rounding for alloca operations when the requested
alignment is equal to the stack alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40004 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Transforms/SimplifyLibCalls/Pow.ll b/test/Transforms/SimplifyLibCalls/Pow.ll
new file mode 100644
index 0000000..773ba1e
--- /dev/null
+++ b/test/Transforms/SimplifyLibCalls/Pow.ll
@@ -0,0 +1,24 @@
+; Testcase for calls to the standard C "pow" function
+;
+; Equivalent to: http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01786.html
+; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
+; RUN: not grep {call double .pow}
+; END.
+
+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 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
+}
+
+double %test3(double %X) {
+ %Y = call double %pow(double 1.0, double %X)
+ ret double %Y ; 1.0^x always equals 1.0
+}
+