From f3ed03481a5ab9502fb71d8145eb752c5f5f5fc0 Mon Sep 17 00:00:00 2001
From: Chris Lattner <sabre@nondot.org>
Date: Sat, 11 Feb 2006 09:37:07 +0000
Subject: [PATCH] Update comments to be actually accurate

llvm-svn: 26124
---
 .../Transforms/SimplifyLibCalls/Pow.ll        | 34 +++++++++++--------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/llvm/test/Regression/Transforms/SimplifyLibCalls/Pow.ll b/llvm/test/Regression/Transforms/SimplifyLibCalls/Pow.ll
index 4b10ed077ca7..3b9e48c68e30 100644
--- a/llvm/test/Regression/Transforms/SimplifyLibCalls/Pow.ll
+++ b/llvm/test/Regression/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:
-
-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 %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
+}
+