1 ; RUN: opt -S -objc-arc-apelim < %s | FileCheck %s
4 @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 }]
8 declare i32 @bar() nounwind
10 define i32 @foo() nounwind {
15 define internal void @__cxx_global_var_init() {
17 %call = call i32 @foo()
18 store i32 %call, i32* @x, align 4
22 define internal void @__dxx_global_var_init() {
24 %call = call i32 @bar()
25 store i32 %call, i32* @x, align 4
29 ; CHECK: define internal void @_GLOBAL__I_x() {
32 define internal void @_GLOBAL__I_x() {
34 %0 = call i8* @llvm.objc.autoreleasePoolPush() nounwind
35 call void @__cxx_global_var_init()
36 call void @llvm.objc.autoreleasePoolPop(i8* %0) nounwind
40 ; CHECK: define internal void @_GLOBAL__I_y() {
41 ; CHECK: %0 = call i8* @llvm.objc.autoreleasePoolPush() [[NUW:#[0-9]+]]
42 ; CHECK: call void @llvm.objc.autoreleasePoolPop(i8* %0) [[NUW]]
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*)
55 ; CHECK: attributes #0 = { nounwind }