1 ; RUN: opt -passes=lint -disable-output < %s
3 ; This test is meant to prove that the verifier does not report errors for correct
4 ; use of the llvm.eh.exceptionpointer intrinsic.
6 target triple = "x86_64-pc-windows-msvc"
8 declare ptr @llvm.eh.exceptionpointer.p0(token)
9 declare ptr addrspace(1) @llvm.eh.exceptionpointer.p1(token)
13 define void @test1() personality ptr @__CxxFrameHandler3 {
15 invoke void (...) @f(i32 1)
16 to label %exit unwind label %catchpad
18 %cs1 = catchswitch within none [label %do_catch] unwind to caller
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 %exit
28 define void @test2() personality ptr @ProcessManagedException {
30 invoke void (...) @f(i32 1)
31 to label %exit unwind label %catchpad
33 %cs1 = catchswitch within none [label %do_catch] unwind to caller
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 %exit
43 declare i32 @__CxxFrameHandler3(...)
44 declare i32 @ProcessManagedException(...)