Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame^] | 1 | ; PR892 |
| 2 | ; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | \ |
| 3 | ; RUN: not grep alloca |
| 4 | ; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | grep {ret i8} |
| 5 | |
| 6 | target endian = little |
| 7 | target pointersize = 32 |
| 8 | target triple = "i686-apple-darwin8.7.2" |
| 9 | |
| 10 | %struct.Val = type { int*, int } |
| 11 | |
| 12 | implementation ; Functions: |
| 13 | |
| 14 | sbyte* %test(short* %X) { |
| 15 | %X_addr = alloca short* |
| 16 | store short* %X, short** %X_addr |
| 17 | %X_addr = cast short** %X_addr to sbyte** |
| 18 | %tmp = load sbyte** %X_addr |
| 19 | ret sbyte* %tmp |
| 20 | } |
| 21 | |
| 22 | void %test2(long %Op.0) { |
| 23 | %tmp = alloca %struct.Val, align 8 |
| 24 | %tmp1 = alloca %struct.Val, align 8 |
| 25 | %tmp = call ulong %_Z3foov( ) |
| 26 | %tmp1 = cast %struct.Val* %tmp1 to ulong* |
| 27 | store ulong %tmp, ulong* %tmp1 |
| 28 | %tmp = getelementptr %struct.Val* %tmp, int 0, uint 0 |
| 29 | %tmp2 = getelementptr %struct.Val* %tmp1, int 0, uint 0 |
| 30 | %tmp = load int** %tmp2 |
| 31 | store int* %tmp, int** %tmp |
| 32 | %tmp3 = getelementptr %struct.Val* %tmp, int 0, uint 1 |
| 33 | %tmp4 = getelementptr %struct.Val* %tmp1, int 0, uint 1 |
| 34 | %tmp = load int* %tmp4 |
| 35 | store int %tmp, int* %tmp3 |
| 36 | %tmp7 = cast %struct.Val* %tmp to { long }* |
| 37 | %tmp8 = getelementptr { long }* %tmp7, int 0, uint 0 |
| 38 | %tmp9 = load long* %tmp8 |
| 39 | call void %_Z3bar3ValS_( long %Op.0, long %tmp9 ) |
| 40 | ret void |
| 41 | } |
| 42 | |
| 43 | declare ulong %_Z3foov() |
| 44 | |
| 45 | declare void %_Z3bar3ValS_(long, long) |
| 46 | |