From b48ed0f72134c862553b8ff1bf49cab0da6e3fd5 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 4 Aug 2016 21:28:59 +0000 Subject: [PATCH] [CloneFunction] Add a testcase for r277691/r277693 PR28848 had a very nice reduction of the underlying cause of the bug. Our ValueMap had, in an entry for an Instruction, a ConstantInt. This is not at all unexpected but should be handled properly. llvm-svn: 277773 --- .../Transforms/Inline/inline_constprop.ll | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/llvm/test/Transforms/Inline/inline_constprop.ll b/llvm/test/Transforms/Inline/inline_constprop.ll index 813a71cc24e6..ab9e90ca27c6 100644 --- a/llvm/test/Transforms/Inline/inline_constprop.ll +++ b/llvm/test/Transforms/Inline/inline_constprop.ll @@ -301,3 +301,24 @@ entry: ; CHECK-LABEL: define i32 @PR28802( ; CHECK: call i32 @PR28802.external(i32 0) ; CHECK: ret i32 0 + +define internal i32 @PR28848.callee(i32 %p2, i1 %c) { +entry: + br i1 %c, label %cond.end, label %cond.true + +cond.true: + br label %cond.end + +cond.end: + %cond = phi i32 [ 0, %cond.true ], [ %p2, %entry ] + %or = or i32 %cond, %p2 + ret i32 %or +} + +define i32 @PR28848() { +entry: + %call = call i32 @PR28848.callee(i32 0, i1 false) + ret i32 %call +} +; CHECK-LABEL: define i32 @PR28848( +; CHECK: ret i32 0