From f3fbddd3336660b4679e5a4da4129a6d56fd7c0a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 19 Mar 2004 06:07:43 +0000 Subject: 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 --- test/Transforms/InstCombine/alloca.ll | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/Transforms/InstCombine/alloca.ll (limited to 'test/Transforms/InstCombine/alloca.ll') 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 +} -- cgit v1.2.3