1; RUN: llvm-as %s -o %t.new.bc 2; RUN: llvm-link %t.new.bc %S/Inputs/old_global_ctors.3.4.bc | llvm-dis | FileCheck %s 3; RUN: llvm-link %S/Inputs/old_global_ctors.3.4.bc %t.new.bc | llvm-dis | FileCheck %s 4 5; old_global_ctors.3.4.bc contains the following LLVM IL, assembled into 6; bitcode by llvm-as from 3.4. It uses a two element @llvm.global_ctors array. 7; --- 8; declare void @a_global_ctor() 9; declare void @b_global_ctor() 10; 11; @llvm.global_ctors = appending global [2 x { i32, void ()* } ] [ 12; { i32, void ()* } { i32 65535, void ()* @a_global_ctor }, 13; { i32, void ()* } { i32 65535, void ()* @b_global_ctor } 14; ] 15; --- 16 17declare void @c_global_ctor() 18declare void @d_global_ctor() 19 20@llvm.global_ctors = appending global [2 x { i32, void ()*, i8* } ] [ 21 { i32, void ()*, i8* } { i32 65535, void ()* @c_global_ctor, i8* null }, 22 { i32, void ()*, i8* } { i32 65535, void ()* @d_global_ctor, i8* null } 23] 24 25; CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [ 26; CHECK-DAG: { i32, void ()*, i8* } { i32 65535, void ()* @a_global_ctor, i8* null } 27; CHECK-DAG: { i32, void ()*, i8* } { i32 65535, void ()* @b_global_ctor, i8* null } 28; CHECK-DAG: { i32, void ()*, i8* } { i32 65535, void ()* @c_global_ctor, i8* null } 29; CHECK-DAG: { i32, void ()*, i8* } { i32 65535, void ()* @d_global_ctor, i8* null } 30; CHECK: ] 31