New testcase, the optimizer can delete zero sized allocas
authorChris Lattner <sabre@nondot.org>
Fri, 19 Mar 2004 06:07:43 +0000 (06:07 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 19 Mar 2004 06:07:43 +0000 (06:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12506 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/alloca.ll [new file with mode: 0644]

diff --git a/test/Transforms/InstCombine/alloca.ll b/test/Transforms/InstCombine/alloca.ll
new file mode 100644 (file)
index 0000000..23a52c3
--- /dev/null
@@ -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
+}