mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-05 17:30:02 +00:00
f9096e450b
point to ARC-managed pointers sometimes. This fixes rdar://10551239. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146577 91177308-0d34-0410-b5e6-96231b3b80d8
32 lines
1.0 KiB
LLVM
32 lines
1.0 KiB
LLVM
; RUN: opt -objc-arc -S < %s | FileCheck %s
|
|
|
|
; Don't hoist @objc_release past a use of its pointer, even
|
|
; if the use has function type, because clang uses function types
|
|
; in dubious ways.
|
|
; rdar://10551239
|
|
|
|
; CHECK: define void @test0(
|
|
; CHECK: %otherBlock = phi void ()* [ %b1, %if.then ], [ null, %entry ]
|
|
; CHECK-NEXT: call void @use_fptr(void ()* %otherBlock)
|
|
; CHECK-NEXT: %tmp11 = bitcast void ()* %otherBlock to i8*
|
|
; CHECK-NEXT: call void @objc_release(i8* %tmp11)
|
|
|
|
define void @test0(i1 %tobool, void ()* %b1) {
|
|
entry:
|
|
br i1 %tobool, label %if.end, label %if.then
|
|
|
|
if.then: ; preds = %entry
|
|
br label %if.end
|
|
|
|
if.end: ; preds = %if.then, %entry
|
|
%otherBlock = phi void ()* [ %b1, %if.then ], [ null, %entry ]
|
|
call void @use_fptr(void ()* %otherBlock)
|
|
%tmp11 = bitcast void ()* %otherBlock to i8*
|
|
call void @objc_release(i8* %tmp11) nounwind
|
|
ret void
|
|
}
|
|
|
|
declare void @use_fptr(void ()*)
|
|
declare void @objc_release(i8*)
|
|
|