summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-15 09:31:54 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-15 09:31:54 +0000
commitc50394fcfaf9d9dfcae806747c9720843200ebb9 (patch)
tree4227aae017be74203ce3728a35337b86707d06f7 /llvm
parent067edd342f2dbf10d7d8c36a543daa3411ef3679 (diff)
downloadbcm5719-llvm-c50394fcfaf9d9dfcae806747c9720843200ebb9.tar.gz
bcm5719-llvm-c50394fcfaf9d9dfcae806747c9720843200ebb9.zip
Add a corollary test for PR14572. We got this code path correct already.
llvm-svn: 170271
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/Transforms/SROA/basictest.ll20
1 files changed, 18 insertions, 2 deletions
diff --git a/llvm/test/Transforms/SROA/basictest.ll b/llvm/test/Transforms/SROA/basictest.ll
index ba93e04a51d..7856a7e4396 100644
--- a/llvm/test/Transforms/SROA/basictest.ll
+++ b/llvm/test/Transforms/SROA/basictest.ll
@@ -1177,10 +1177,10 @@ entry:
ret void
}
-define <3 x i8> @PR14572(i32 %x) {
+define <3 x i8> @PR14572.1(i32 %x) {
; Ensure that a split integer store which is wider than the type size of the
; alloca (relying on the alloc size padding) doesn't trigger an assert.
-; CHECK: @PR14572
+; CHECK: @PR14572.1
entry:
%a = alloca <3 x i8>, align 4
@@ -1192,3 +1192,19 @@ entry:
ret <3 x i8> %y
; CHECK: ret <3 x i8>
}
+
+define i32 @PR14572.2(<3 x i8> %x) {
+; Ensure that a split integer load which is wider than the type size of the
+; alloca (relying on the alloc size padding) doesn't trigger an assert.
+; CHECK: @PR14572.2
+
+entry:
+ %a = alloca <3 x i8>, align 4
+; CHECK-NOT: alloca
+
+ store <3 x i8> %x, <3 x i8>* %a, align 1
+ %cast = bitcast <3 x i8>* %a to i32*
+ %y = load i32* %cast, align 4
+ ret i32 %y
+; CHECK: ret i32
+}
OpenPOWER on IntegriCloud