aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll
blob: 3b63efa4464c134fdca8c8f8a3fc2667ed3c6bce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; Promoting some values allows promotion of other values.
; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep alloca

int %test2() {
        %result = alloca int             ; ty=int*
        %a = alloca int          ; ty=int*
        %p = alloca int*                 ; ty=int**
        store int 0, int* %a
        store int* %a, int** %p
        %tmp.0 = load int** %p           ; ty=int*
        %tmp.1 = load int* %tmp.0                ; ty=int
        store int %tmp.1, int* %result
        %tmp.2 = load int* %result               ; ty=int
        ret int %tmp.2
}