1 ; RUN: opt -passes=objc-arc -S < %s | FileCheck -check-prefix=ENABLE -check-prefix=CHECK %s
2 ; RUN: opt -passes=objc-arc -arc-opt-max-ptr-states=1 -S < %s | FileCheck -check-prefix=DISABLE -check-prefix=CHECK %s
4 @g0 = common global ptr null, align 8
6 ; CHECK: call ptr @llvm.objc.retain
7 ; ENABLE-NOT: call ptr @llvm.objc.retain
8 ; DISABLE: call ptr @llvm.objc.retain
9 ; CHECK: call void @llvm.objc.release
10 ; ENABLE-NOT: call void @llvm.objc.release
11 ; DISABLE: call void @llvm.objc.release
13 define void @foo0(ptr %a) {
14 %1 = tail call ptr @llvm.objc.retain(ptr %a)
15 %2 = tail call ptr @llvm.objc.retain(ptr %a)
16 %3 = load ptr, ptr @g0, align 8
17 store ptr %a, ptr @g0, align 8
18 tail call void @llvm.objc.release(ptr %3)
19 tail call void @llvm.objc.release(ptr %a), !clang.imprecise_release !0
23 declare ptr @llvm.objc.retain(ptr)
24 declare void @llvm.objc.release(ptr)