1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -globalopt < %s | FileCheck %s
4 ; The global is stored once through a trivial GEP instruction (rather than
5 ; GEP constant expression) here. We should still be able to optimize it.
9 @g = internal unnamed_addr global i32 undef
13 define void @store() {
14 ; CHECK-LABEL: @store(
15 ; CHECK-NEXT: ret void
17 %addr = getelementptr inbounds %s, %s* bitcast (i32* @g to %s*), i64 0, i32 0
18 store i32 1, i32* %addr, align 4
24 ; CHECK-NEXT: call fastcc void @store()
25 ; CHECK-NEXT: ret i32 1
27 call fastcc void @store()
28 %v = load i32, i32* @g