Chris Lattner | 340ab5b | 2005-01-31 04:49:22 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | opt -instcombine -globaldce | llvm-dis | not grep Array |
| 2 | |
| 3 | ; Pulling the cast out of the load allows us to eliminate the load, and then |
| 4 | ; the whole array. |
| 5 | |
| 6 | %unop = type {int } |
| 7 | %op = type {float} |
| 8 | |
| 9 | %Array = internal constant [1 x %op* (%op*)*] [ %op* (%op*)* %foo ] |
| 10 | |
| 11 | implementation |
| 12 | |
| 13 | %op* %foo(%op* %X) { |
| 14 | ret %op* %X |
| 15 | } |
| 16 | |
| 17 | %unop* %caller(%op* %O) { |
| 18 | %tmp = load %unop* (%op*)** cast ([1 x %op* (%op*)*]* %Array to %unop* (%op*)**) |
| 19 | %tmp.2 = call %unop* (%op*)* %tmp(%op* %O) |
| 20 | ret %unop* %tmp.2 |
| 21 | } |
| 22 | |