]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Transforms/GlobalOpt/storepointer-no-null-opt.ll
Vendor import of llvm trunk r338150:
[FreeBSD/FreeBSD.git] / test / Transforms / GlobalOpt / storepointer-no-null-opt.ll
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
27 attributes #0 = { "null-pointer-is-valid"="true" }