brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 9f047c2 Raw
41 lines · plain
1; RUN: opt -mtriple=x86_64-windows-msvc -passes=objc-arc -S < %s | FileCheck %s2 3; Check that funclet tokens are preserved4;5; CHECK-LABEL:  catch:6; CHECK:          %1 = catchpad within %07; CHECK:          %2 = tail call ptr @llvm.objc.retain(ptr %exn) #0 [ "funclet"(token %1) ]8; CHECK:          call void @llvm.objc.release(ptr %exn) #0 [ "funclet"(token %1) ]9; CHECK:          catchret from %1 to label %eh.cont10 11define void @try_catch_with_objc_intrinsic() personality ptr @__CxxFrameHandler3 {12entry:13  %exn.slot = alloca ptr, align 814  invoke void @may_throw(ptr null) to label %eh.cont unwind label %catch.dispatch15 16catch.dispatch:                                   ; preds = %entry17  %0 = catchswitch within none [label %catch] unwind to caller18 19eh.cont:                                          ; preds = %catch, %entry20  ret void21 22catch:                                            ; preds = %catch.dispatch23  %1 = catchpad within %0 [ptr null, i32 0, ptr %exn.slot]24  br label %if.then25 26if.then:                                          ; preds = %catch27  %exn = load ptr, ptr null, align 828  %2 = call ptr @llvm.objc.retain(ptr %exn) [ "funclet"(token %1) ]29  call void @may_throw(ptr %exn)30  call void @llvm.objc.release(ptr %exn) [ "funclet"(token %1) ]31  catchret from %1 to label %eh.cont32}33 34declare void @may_throw(ptr)35declare i32 @__CxxFrameHandler3(...)36 37declare ptr @llvm.objc.retain(ptr) #038declare void @llvm.objc.release(ptr) #039 40attributes #0 = { nounwind }41