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