blob: 3b63efa4464c134fdca8c8f8a3fc2667ed3c6bce [file] [log] [blame]
Chris Lattner4f7ae852003-06-25 14:55:30 +00001; Promoting some values allows promotion of other values.
Misha Brukmane78760e2003-09-16 15:29:54 +00002; RUN: llvm-as < %s | 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