1 ; PR48055. Check that this does not crash.
2 ; RUN: opt -passes=globalopt %s -disable-output
3 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 %struct.g = type opaque
7 %struct.a = type { ptr }
9 @l = dso_local global i32 0, align 4
10 @h = external dso_local global %struct.g, align 1
11 @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I_bug48055.cc, ptr null }]
13 ; Function Attrs: uwtable
14 define internal void @__cxx_global_var_init() {
16 %vtable = load ptr, ptr @h, align 1
17 %0 = load ptr, ptr %vtable, align 8
18 %call = call i32 %0(ptr nonnull dereferenceable(8) @h)
19 store i32 %call, ptr @l, align 4
23 ; Function Attrs: uwtable
24 define internal void @_GLOBAL__sub_I_bug48055.cc() {
26 call void @__cxx_global_var_init()