1 ; RUN: sed -e s/.Cxx:// %s | opt -mtriple=i386-pc-windows-msvc -S -x86-winehstate | FileCheck %s
2 ; RUN: sed -e s/.SEH:// %s | opt -mtriple=i386-pc-windows-msvc -S -x86-winehstate | FileCheck %s
4 declare i32 @__CxxFrameHandler3(...)
5 declare i32 @_except_handler3(...)
6 declare void @dummy_filter()
10 ; CHECK-LABEL: define void @test2(
11 ;Cxx: define void @test2(i1 %b) personality ptr @__CxxFrameHandler3 {
12 ;SEH: define void @test2(i1 %b) personality ptr @_except_handler3 {
16 ; CHECK: invoke void @f(i32 1)
18 to label %exit unwind label %cleanup.pad
20 %cleanup = cleanuppad within none []
21 br i1 %b, label %left, label %right
23 cleanupret from %cleanup unwind label %catch.pad
25 cleanupret from %cleanup unwind label %catch.pad
27 %cs1 = catchswitch within none [label %catch.body] unwind to caller
29 ;Cxx: %catch = catchpad within %cs1 [ptr null, i32 u0x40, ptr null]
30 ;SEH: %catch = catchpad within %cs1 [ptr @dummy_filter]
31 catchret from %catch to label %exit
36 ; CHECK-LABEL: define void @test3(
37 ;Cxx: define void @test3() personality ptr @__CxxFrameHandler3 {
38 ;SEH: define void @test3() personality ptr @_except_handler3 {
42 ; CHECK: invoke void @f(i32 1)
44 to label %exit unwind label %cleanup.pad
47 ; CHECK: invoke void @f(i32 0)
48 %cleanup = cleanuppad within none []
50 to label %unreachable unwind label %catch.pad
54 %cs1 = catchswitch within none [label %catch.body] unwind to caller
56 ;Cxx: %catch = catchpad within %cs1 [ptr null, i32 u0x40, ptr null]
57 ;SEH: %catch = catchpad within %cs1 [ptr @dummy_filter]
58 catchret from %catch to label %exit