Chris Lattner | 95481b1 | 2004-03-08 00:58:19 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | opt -argpromotion -instcombine | not grep load |
| 2 | |
| 3 | %QuadTy = type {int, int, int, int} |
| 4 | |
| 5 | %G = constant %QuadTy {int 0, int 0, int 17, int 25 } |
| 6 | |
| 7 | implementation |
| 8 | |
| 9 | internal int %test(%QuadTy* %P) { |
| 10 | %A = getelementptr %QuadTy* %P, long 0, ubyte 3 |
| 11 | %B = getelementptr %QuadTy* %P, long 0, ubyte 2 |
| 12 | %a = load int* %A |
| 13 | %b = load int* %B |
| 14 | %V = add int %a, %b |
| 15 | ret int %V |
| 16 | } |
| 17 | |
| 18 | int %caller() { |
| 19 | %V = call int %test(%QuadTy* %G) |
| 20 | ret int %V |
| 21 | } |