From aa52fd10abd8bce76d8c8f0a16d6f8138a82902e Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 19 Jul 2010 08:14:26 +0000 Subject: [PATCH] Testcase for r108687. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108689 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/2010-07-19-sqrt.ll | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/Transforms/InstCombine/2010-07-19-sqrt.ll 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 00000000000..65053820482 --- /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 ; [#uses=1] + %call = tail call double @sqrt(double %conv) nounwind ; [#uses=1] + %conv1 = fptrunc double %call to float ; [#uses=1] +; CHECK: ret float + ret float %conv1 +} + +declare double @sqrt(double) readnone