Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -globalopt -S | FileCheck %s |
| 2 | |
| 3 | @G = internal global void ()* null ; <void ()**> [#uses=2] |
| 4 | ; CHECK: global |
| 5 | |
| 6 | define internal void @Actual() { |
| 7 | ; CHECK-LABEL: Actual( |
| 8 | ret void |
| 9 | } |
| 10 | |
| 11 | define void @init() { |
| 12 | ; CHECK-LABEL: init( |
| 13 | ; CHECK: store void ()* @Actual, void ()** @G |
| 14 | store void ()* @Actual, void ()** @G |
| 15 | ret void |
| 16 | } |
| 17 | |
| 18 | define void @doit() #0 { |
| 19 | ; CHECK-LABEL: doit( |
| 20 | ; CHECK: %FP = load void ()*, void ()** @G |
| 21 | ; CHECK: call void %FP() |
| 22 | %FP = load void ()*, void ()** @G ; <void ()*> [#uses=1] |
| 23 | call void %FP( ) |
| 24 | ret void |
| 25 | } |
| 26 | |
Nikita Popov | f89f7da | 2020-04-25 12:57:07 +0200 | [diff] [blame] | 27 | attributes #0 = { null_pointer_is_valid } |