aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/SROA/basictest.ll
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-15 09:26:06 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-15 09:26:06 +0000
commit19820053fe46dbc91c43edb80a693fa6aae09251 (patch)
treed39d2db08e15efd61dfcb1759f31f75f2f6a1bd6 /test/Transforms/SROA/basictest.ll
parent5db4bceb47e8db48522ecd94fcfd7747451157bd (diff)
downloadexternal_llvm-19820053fe46dbc91c43edb80a693fa6aae09251.zip
external_llvm-19820053fe46dbc91c43edb80a693fa6aae09251.tar.gz
external_llvm-19820053fe46dbc91c43edb80a693fa6aae09251.tar.bz2
Relax an overly aggressive assert to fix PR14572.
The alloca width is based on the alloc size, not the type size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SROA/basictest.ll')
-rw-r--r--test/Transforms/SROA/basictest.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/SROA/basictest.ll b/test/Transforms/SROA/basictest.ll
index d8b6b41..ba93e04 100644
--- a/test/Transforms/SROA/basictest.ll
+++ b/test/Transforms/SROA/basictest.ll
@@ -1176,3 +1176,19 @@ entry:
%baz = load i1* %a.i1, align 1
ret void
}
+
+define <3 x i8> @PR14572(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
+
+entry:
+ %a = alloca <3 x i8>, align 4
+; CHECK-NOT: alloca
+
+ %cast = bitcast <3 x i8>* %a to i32*
+ store i32 %x, i32* %cast, align 1
+ %y = load <3 x i8>* %a, align 4
+ ret <3 x i8> %y
+; CHECK: ret <3 x i8>
+}