1 ; RUN: opt -S -objc-arc-apelim < %s | FileCheck %s
5 @llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_x, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_y, i8* null }]
9 declare i32 @bar() nounwind
11 define linkonce_odr i32 @foo() nounwind {
16 define internal void @__cxx_global_var_init() {
18 %call = call i32 @foo()
19 store i32 %call, i32* @x, align 4
23 define internal void @__dxx_global_var_init() {
25 %call = call i32 @bar()
26 store i32 %call, i32* @x, align 4
30 ; CHECK-LABEL: define internal void @_GLOBAL__I_x() {
31 define internal void @_GLOBAL__I_x() {
33 ; CHECK: call i8* @llvm.objc.autoreleasePoolPush()
34 ; CHECK-NEXT: call void @__cxx_global_var_init()
35 ; CHECK-NEXT: call void @llvm.objc.autoreleasePoolPop(i8* %0)
36 ; CHECK-NEXT: ret void
38 %0 = call i8* @llvm.objc.autoreleasePoolPush() nounwind
39 call void @__cxx_global_var_init()
40 call void @llvm.objc.autoreleasePoolPop(i8* %0) nounwind
44 define internal void @_GLOBAL__I_y() {
46 %0 = call i8* @llvm.objc.autoreleasePoolPush() nounwind
47 call void @__dxx_global_var_init()
48 call void @llvm.objc.autoreleasePoolPop(i8* %0) nounwind
52 declare i8* @llvm.objc.autoreleasePoolPush()
53 declare void @llvm.objc.autoreleasePoolPop(i8*)