blob: ce274fa327e92926ecc3ec13dd75cacf90ebfc07 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Promoting some values allows promotion of other values.
2; RUN: llvm-upgrade < %s | llvm-as | opt -mem2reg | llvm-dis | not grep alloca
3
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