1; RUN: opt -mtriple=x86_64-windows-msvc -passes=objc-arc -S < %s | FileCheck %s 2 3; Check that funclet tokens are preserved 4; 5; CHECK-LABEL: catch: 6; CHECK: %1 = catchpad within %0 7; 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.cont 10 11define void @try_catch_with_objc_intrinsic() personality ptr @__CxxFrameHandler3 { 12entry: 13 %exn.slot = alloca ptr, align 8 14 invoke void @may_throw(ptr null) to label %eh.cont unwind label %catch.dispatch 15 16catch.dispatch: ; preds = %entry 17 %0 = catchswitch within none [label %catch] unwind to caller 18 19eh.cont: ; preds = %catch, %entry 20 ret void 21 22catch: ; preds = %catch.dispatch 23 %1 = catchpad within %0 [ptr null, i32 0, ptr %exn.slot] 24 br label %if.then 25 26if.then: ; preds = %catch 27 %exn = load ptr, ptr null, align 8 28 %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.cont 32} 33 34declare void @may_throw(ptr) 35declare i32 @__CxxFrameHandler3(...) 36 37declare ptr @llvm.objc.retain(ptr) #0 38declare void @llvm.objc.release(ptr) #0 39 40attributes #0 = { nounwind } 41