1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes='default<O2>' -S < %s | FileCheck %s
3 @a = internal global i32 0, align 4
4 @c = internal global ptr @b, align 8
5 @b = internal global ptr null, align 8
6 @e = internal global ptr @d, align 8
7 @d = internal global i32 0, align 4
12 ; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr @e, align 8
13 ; CHECK-NEXT: store i32 0, ptr [[TMP0]], align 4
14 ; CHECK-NEXT: store ptr null, ptr @e, align 8
15 ; CHECK-NEXT: ret i32 0
18 %h = alloca ptr, align 8
19 %i = alloca ptr, align 8
20 %j = alloca ptr, align 8
21 store ptr @a, ptr %h, align 8
22 store ptr @a, ptr %j, align 8
23 %0 = load ptr, ptr %j, align 8
24 store i32 1, ptr %0, align 4
25 store ptr @a, ptr %i, align 8
26 %1 = load ptr, ptr %i, align 8
27 %2 = load ptr, ptr @c, align 8
28 store ptr %1, ptr %2, align 8
29 %3 = load ptr, ptr %h, align 8
30 %call = call ptr @bar(ptr %3)
34 define internal ptr @bar(ptr %g) {
36 %g.addr = alloca ptr, align 8
37 store ptr %g, ptr %g.addr, align 8
38 %0 = load ptr, ptr @e, align 8
39 store i32 0, ptr %0, align 4
40 %1 = load ptr, ptr %g.addr, align 8
41 %2 = load i32, ptr %1, align 4
42 %tobool = icmp ne i32 %2, 0
43 br i1 %tobool, label %if.end, label %if.then
45 if.then: ; preds = %entry
49 if.end: ; preds = %if.then, %entry
50 store ptr null, ptr @e, align 8
51 %3 = load ptr, ptr @b, align 8