1 ; RUN: opt -objc-arc -S < %s | FileCheck %s
3 ; Don't hoist @llvm.objc.release past a use of its pointer, even
4 ; if the use has function type, because clang uses function types
8 ; CHECK-LABEL: define void @test0(
9 ; CHECK: %otherBlock = phi void ()* [ %b1, %if.then ], [ null, %entry ]
10 ; CHECK-NEXT: call void @use_fptr(void ()* %otherBlock)
11 ; CHECK-NEXT: %tmp11 = bitcast void ()* %otherBlock to i8*
12 ; CHECK-NEXT: call void @llvm.objc.release(i8* %tmp11)
14 define void @test0(i1 %tobool, void ()* %b1) {
16 br i1 %tobool, label %if.end, label %if.then
18 if.then: ; preds = %entry
21 if.end: ; preds = %if.then, %entry
22 %otherBlock = phi void ()* [ %b1, %if.then ], [ null, %entry ]
23 call void @use_fptr(void ()* %otherBlock)
24 %tmp11 = bitcast void ()* %otherBlock to i8*
25 call void @llvm.objc.release(i8* %tmp11) nounwind
29 declare void @use_fptr(void ()*)
30 declare void @llvm.objc.release(i8*)