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