summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/alloca.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-19 06:07:43 +0000
committerChris Lattner <sabre@nondot.org>2004-03-19 06:07:43 +0000
commitf3fbddd3336660b4679e5a4da4129a6d56fd7c0a (patch)
treefe5da22d549f74b44f19658322e169d55cf75c2f /test/Transforms/InstCombine/alloca.ll
parent76cddb08cb1add9ab70c5aa59c6f1d3960a2a974 (diff)
downloadllvm-f3fbddd3336660b4679e5a4da4129a6d56fd7c0a.tar.gz
llvm-f3fbddd3336660b4679e5a4da4129a6d56fd7c0a.tar.bz2
llvm-f3fbddd3336660b4679e5a4da4129a6d56fd7c0a.tar.xz
New testcase, the optimizer can delete zero sized allocas
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12506 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/alloca.ll')
-rw-r--r--test/Transforms/InstCombine/alloca.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/alloca.ll b/test/Transforms/InstCombine/alloca.ll
new file mode 100644
index 0000000000..23a52c328d
--- /dev/null
+++ b/test/Transforms/InstCombine/alloca.ll
@@ -0,0 +1,14 @@
+; Zero byte allocas should be deleted.
+
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep alloca
+
+declare void %use(...)
+void %test() {
+ %X = alloca [0 x int]
+ call void(...)* %use([0 x int] *%X)
+ %Y = alloca int, uint 0
+ call void(...)* %use(int* %Y)
+ %Z = alloca {}
+ call void(...)* %use({}* %Z)
+ ret void
+}