aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/ScalarRepl/badarray.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/ScalarRepl/badarray.ll')
-rw-r--r--test/Transforms/ScalarRepl/badarray.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/ScalarRepl/badarray.ll b/test/Transforms/ScalarRepl/badarray.ll
new file mode 100644
index 0000000..f525255
--- /dev/null
+++ b/test/Transforms/ScalarRepl/badarray.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl -mem2reg | llvm-dis | grep alloca
+
+int %test() {
+ %X = alloca [ 4 x int ]
+ %Y = getelementptr [4x int]* %X, long 0, long 6 ; Off end of array!
+ store int 0, int* %Y
+
+ %Z = load int* %Y
+ ret int %Z
+}