aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/SROA/basictest.ll
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2012-09-25 21:15:50 +0000
committerNick Lewycky <nicholas@mxc.ca>2012-09-25 21:15:50 +0000
commitc3f10e43fc4b1084bc109ff740d9ba4b6eaced0a (patch)
tree992ee824143c08c0e61cefc1a5a4dbe7be0cb880 /test/Transforms/SROA/basictest.ll
parentba48ceb1a3802e20e781ef04ea2573ffae2ac414 (diff)
Don't try to promote the same alloca twice. Fixes PR13916!
Chandler, it's not obvious that it's okay that this alloca gets into the list twice to begin with. Please review and see whether this is the fix you really want, but I wanted to get a fix checked in quickly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164634 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SROA/basictest.ll')
-rw-r--r--test/Transforms/SROA/basictest.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Transforms/SROA/basictest.ll b/test/Transforms/SROA/basictest.ll
index a61de05f45..359a56a00d 100644
--- a/test/Transforms/SROA/basictest.ll
+++ b/test/Transforms/SROA/basictest.ll
@@ -855,3 +855,25 @@ entry:
%result = or i8 %load, %load2
ret i8 %result
}
+
+%test22.struct = type { i8 }
+
+define void @test22() {
+; CHECK: @test22
+; CHECK-NOT: alloca
+; CHECK: ret void
+; PR13916
+entry:
+ %A = alloca %test22.struct
+ br i1 undef, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ %tmp = bitcast %test22.struct* %A to i8*
+ %tmp1 = bitcast %test22.struct* %A to i8*
+ call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp, i8* %tmp1, i32 1, i32 1, i1 false)
+ unreachable
+
+if.end: ; preds = %entry
+ %tmp2 = load %test22.struct* %A
+ ret void
+}