blob: ce274fa327e92926ecc3ec13dd75cacf90ebfc07 [file] [log] [blame]
Chris Lattner4f7ae852003-06-25 14:55:30 +00001; Promoting some values allows promotion of other values.
Reid Spencer69ccadd2006-12-02 04:23:10 +00002; RUN: llvm-upgrade < %s | llvm-as | opt -mem2reg | llvm-dis | not grep alloca
Chris Lattner4f7ae852003-06-25 14:55:30 +00003
4int %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