Model stacksave and stackrestore as both writing memory, since we
[oota-llvm.git] / test / Transforms / Mem2Reg / 2003-06-26-IterativePromote.ll
1 ; Promoting some values allows promotion of other values.
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -mem2reg | llvm-dis | not grep alloca
3
4 int %test2() {
5         %result = alloca int             ; ty=int*
6         %a = alloca int          ; ty=int*
7         %p = alloca int*                 ; ty=int**
8         store int 0, int* %a
9         store int* %a, int** %p
10         %tmp.0 = load int** %p           ; ty=int*
11         %tmp.1 = load int* %tmp.0                ; ty=int
12         store int %tmp.1, int* %result
13         %tmp.2 = load int* %result               ; ty=int
14         ret int %tmp.2
15 }
16