brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · d62799e Raw
45 lines · plain
1; RUN: opt -passes=lint -disable-output < %s2 3; This test is meant to prove that the verifier does not report errors for correct4; use of the llvm.eh.exceptionpointer intrinsic.5 6target triple = "x86_64-pc-windows-msvc"7 8declare ptr @llvm.eh.exceptionpointer.p0(token)9declare ptr addrspace(1) @llvm.eh.exceptionpointer.p1(token)10 11declare void @f(...)12 13define void @test1() personality ptr @__CxxFrameHandler3 {14entry:15  invoke void (...) @f(i32 1)16     to label %exit unwind label %catchpad17catchpad:18  %cs1 = catchswitch within none [label %do_catch] unwind to caller19do_catch:20  %catch = catchpad within %cs1 [i32 1]21  %exn = call ptr @llvm.eh.exceptionpointer.p0(token %catch)22  call void (...) @f(ptr %exn)23  catchret from %catch to label %exit24exit:25  ret void26}27 28define void @test2() personality ptr @ProcessManagedException {29entry:30  invoke void (...) @f(i32 1)31     to label %exit unwind label %catchpad32catchpad:33  %cs1 = catchswitch within none [label %do_catch] unwind to caller34do_catch:35  %catch = catchpad within %cs1 [i32 1]36  %exn = call ptr addrspace(1) @llvm.eh.exceptionpointer.p1(token %catch)37  call void (...) @f(ptr addrspace(1) %exn)38  catchret from %catch to label %exit39exit:40  ret void41}42 43declare i32 @__CxxFrameHandler3(...)44declare i32 @ProcessManagedException(...)45