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 i32** @b, align 8
5 @b = internal global i32* null, align 8
6 @e = internal global i32* @d, align 8
7 @d = internal global i32 0, align 4
12 ; CHECK-NEXT: [[TMP0:%.*]] = load i32*, i32** @e, align 8
13 ; CHECK-NEXT: store i32 0, i32* [[TMP0]], align 4
14 ; CHECK-NEXT: store i32* null, i32** @e, align 8
15 ; CHECK-NEXT: ret i32 0
18 %h = alloca i32*, align 8
19 %i = alloca i32*, align 8
20 %j = alloca i32*, align 8
21 %0 = bitcast i32** %h to i8*
22 store i32* @a, i32** %h, align 8
23 %1 = bitcast i32** %i to i8*
24 %2 = bitcast i32** %j to i8*
25 store i32* @a, i32** %j, align 8
26 %3 = load i32*, i32** %j, align 8
27 store i32 1, i32* %3, align 4
28 store i32* @a, i32** %i, align 8
29 %4 = load i32*, i32** %i, align 8
30 %5 = load i32**, i32*** @c, align 8
31 store i32* %4, i32** %5, align 8
32 %6 = load i32*, i32** %h, align 8
33 %call = call i32* @bar(i32* %6)
34 %7 = bitcast i32** %j to i8*
35 %8 = bitcast i32** %i to i8*
36 %9 = bitcast i32** %h to i8*
40 define internal i32* @bar(i32* %g) {
42 %g.addr = alloca i32*, align 8
43 store i32* %g, i32** %g.addr, align 8
44 %0 = load i32*, i32** @e, align 8
45 store i32 0, i32* %0, align 4
46 %1 = load i32*, i32** %g.addr, align 8
47 %2 = load i32, i32* %1, align 4
48 %tobool = icmp ne i32 %2, 0
49 br i1 %tobool, label %if.end, label %if.then
51 if.then: ; preds = %entry
55 if.end: ; preds = %if.then, %entry
56 store i32* null, i32** @e, align 8
57 %3 = load i32*, i32** @b, align 8