brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · d0b8ce9 Raw
36 lines · plain
1; RUN: opt -passes=objc-arc-contract -arc-contract-use-objc-claim-rv=1 -S < %s | FileCheck %s --check-prefixes=CHECK,CLAIM2; RUN: opt -passes=objc-arc-contract -arc-contract-use-objc-claim-rv=0 -S < %s | FileCheck %s --check-prefixes=CHECK,RETAIN3 4; CHECK-LABEL: define void @test0() {5; CLAIM: %[[CALL:.*]] = notail call ptr @foo() [ "clang.arc.attachedcall"(ptr @llvm.objc.claimAutoreleasedReturnValue) ]6; RETAIN: %[[CALL:.*]] = notail call ptr @foo() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]7; CHECK-NEXT: ret void8 9define void @test0() {10  %call1 = call ptr @foo() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]11  ret void12}13 14; CHECK-LABEL: define void @test1() {15; CHECK: %[[CALL:.*]] = notail call ptr @foo() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]16; CHECK-NEXT: ret void17 18define void @test1() {19  %call1 = call ptr @foo() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]20  ret void21}22 23; CHECK-LABEL: define void @test2() {24; CLAIM: %[[CALL:.*]] = notail call ptr @foo() [ "clang.arc.attachedcall"(ptr @llvm.objc.claimAutoreleasedReturnValue), "otherbundle"() ]25; RETAIN: %[[CALL:.*]] = notail call ptr @foo() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue), "otherbundle"() ]26; CHECK-NEXT: ret void27 28define void @test2() {29  %call1 = call ptr @foo() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue), "otherbundle"() ]30  ret void31}32 33declare ptr @foo()34declare ptr @llvm.objc.retainAutoreleasedReturnValue(ptr)35declare ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue(ptr)36