For PR1319:
[oota-llvm.git] / test / Transforms / InstCombine / alloca.ll
1 ; Zero byte allocas should be deleted.
2
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
4 ; RUN:   not grep alloca
5 ; END.
6
7 declare void %use(...)
8 void %test() {
9         %X = alloca [0 x int]
10         call void(...)* %use([0 x int] *%X)
11         %Y = alloca int, uint 0
12         call void(...)* %use(int* %Y)
13         %Z = alloca {}
14         call void(...)* %use({}* %Z)
15         ret void
16 }
17
18 void %test2() {
19         %A = alloca int    ;; dead.
20         store int 123, int* %A
21         ret void
22 }
23
24 void %test3() {
25         %A = alloca {int}    ;; dead.
26         %B = getelementptr {int}* %A, int 0, uint 0
27         store int 123, int* %B
28         ret void
29 }