1 ; RUN: opt < %s -passes=globalopt -S | FileCheck %s
3 @G = internal global i32 17 ; <ptr> [#uses=3]
7 %V = load i32, ptr @G ; <i32> [#uses=1]
11 ; CHECK-NEXT: ret void
15 %X = load i32, ptr @G ; <i32> [#uses=1]
18 ; CHECK-NEXT: ret i32 17
21 @a = internal global ptr null, align 8
25 define void @qux() nounwind {
26 %g = getelementptr ptr, ptr @a, i32 1
27 %cmp = icmp ne ptr null, @a
28 %cmp2 = icmp eq ptr null, @a
29 %cmp3 = icmp eq ptr null, %g
30 store ptr inttoptr (i64 1 to ptr), ptr @a, align 8
31 %l = load ptr, ptr @a, align 8
38 @addrspacecast_a = internal global ptr null
40 define void @addrspacecast_user() {
41 ; CHECK-LABEL: @addrspacecast_user
44 %g = addrspacecast ptr @addrspacecast_a to ptr addrspace(1)
45 store ptr inttoptr (i64 1 to ptr), ptr @addrspacecast_a, align 8
46 %l = load ptr, ptr @addrspacecast_a, align 8