summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-07-19 08:14:26 +0000
committerOwen Anderson <resistor@mac.com>2010-07-19 08:14:26 +0000
commitaa52fd10abd8bce76d8c8f0a16d6f8138a82902e (patch)
treed234a501405100aeaa8a9399fd9b4691061ced96 /test/Transforms/InstCombine
parent54026c0f1b10fc6335f2a090c12627e5f7126641 (diff)
downloadllvm-aa52fd10abd8bce76d8c8f0a16d6f8138a82902e.tar.gz
llvm-aa52fd10abd8bce76d8c8f0a16d6f8138a82902e.tar.bz2
llvm-aa52fd10abd8bce76d8c8f0a16d6f8138a82902e.tar.xz
Testcase for r108687.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108689 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r--test/Transforms/InstCombine/2010-07-19-sqrt.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2010-07-19-sqrt.ll b/test/Transforms/InstCombine/2010-07-19-sqrt.ll
new file mode 100644
index 0000000000..6505382048
--- /dev/null
+++ b/test/Transforms/InstCombine/2010-07-19-sqrt.ll
@@ -0,0 +1,16 @@
+; RUN: opt -S -instcombine %s | FileCheck %s
+
+define float @foo(float %x) nounwind readnone ssp {
+entry:
+; CHECK-NOT: fpext
+; CHECK-NOT: sqrt(
+; CHECK: sqrtf(
+; CHECK-NOT: fptrunc
+ %conv = fpext float %x to double ; <double> [#uses=1]
+ %call = tail call double @sqrt(double %conv) nounwind ; <double> [#uses=1]
+ %conv1 = fptrunc double %call to float ; <float> [#uses=1]
+; CHECK: ret float
+ ret float %conv1
+}
+
+declare double @sqrt(double) readnone