Reid Spencer | 951d8dc | 2007-04-15 08:30:33 +0000 | [diff] [blame] | 1 | ; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | \ |
| 2 | ; RUN: grep {call void @Actual} |
Chris Lattner | cd1e756 | 2004-10-10 23:12:33 +0000 | [diff] [blame] | 3 | |
| 4 | ; Check that a comparison does not prevent an indirect call from being made |
| 5 | ; direct. The global will still remain, but indirect call elim is still good. |
| 6 | |
| 7 | %G = internal global void ()* null |
| 8 | |
| 9 | implementation |
| 10 | |
| 11 | internal void %Actual() { |
| 12 | ret void |
| 13 | } |
| 14 | |
| 15 | void %init() { |
| 16 | store void()* %Actual, void()** %G |
| 17 | ret void |
| 18 | } |
| 19 | |
| 20 | void %doit() { |
| 21 | %FP = load void()** %G |
| 22 | %CC = seteq void()* %FP, null |
| 23 | br bool %CC, label %isNull, label %DoCall |
| 24 | DoCall: |
| 25 | call void %FP() |
| 26 | ret void |
| 27 | isNull: |
| 28 | ret void |
| 29 | } |