1 ; RUN: opt < %s -S -globalopt | FileCheck %s
3 ; This global is externally_initialized, which may modify the value between
4 ; it's static initializer and any code in this module being run, so the only
5 ; write to it cannot be merged into the static initialiser.
6 ; CHECK: @a = internal unnamed_addr externally_initialized global i32 undef
7 @a = internal externally_initialized global i32 undef
9 ; This global is stored to by the external initialization, so cannot be
10 ; constant-propagated and removed, despite the fact that there are no writes
12 ; CHECK: @b = internal unnamed_addr externally_initialized global i32 undef
13 @b = internal externally_initialized global i32 undef
19 ; CHECK: store i32 42, i32* @a
26 ; CHECK: %val = load i32, i32* @a
27 %val = load i32, i32* @a
34 ; CHECK: %val = load i32, i32* @b
35 %val = load i32, i32* @b