• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: sed -e s/.Cxx:// %s | llc -mtriple=x86_64-pc-windows-msvc | FileCheck %s --check-prefix=CXX
2; RUN: sed -e s/.Seh:// %s | llc -mtriple=x86_64-pc-windows-msvc | FileCheck %s --check-prefix=SEH
3
4declare i32 @__CxxFrameHandler3(...)
5declare i32 @__C_specific_handler(...)
6declare void @dummy_filter()
7
8declare void @f(i32)
9
10;Cxx: define void @test() personality i32 (...)* @__CxxFrameHandler3 {
11;Seh: define void @test() personality i32 (...)* @__C_specific_handler {
12entry:
13  invoke void @f(i32 1)
14          to label %invoke.cont unwind label %catch.dispatch
15
16catch.dispatch:
17  %cs1 = catchswitch within none [label %catch.body] unwind label %catch.dispatch.2
18
19catch.body:
20;Cxx: %catch = catchpad within %cs1 [i8* null, i32 u0x40, i8* null]
21;Seh: %catch = catchpad within %cs1 [void ()* @dummy_filter]
22  invoke void @f(i32 2) [ "funclet"(token %catch) ]
23          to label %unreachable unwind label %terminate
24
25terminate:
26  %cleanup = cleanuppad within %catch []
27  call void @f(i32 3) [ "funclet"(token %cleanup) ]
28  unreachable
29
30unreachable:
31  unreachable
32
33invoke.cont:
34  ret void
35
36catch.dispatch.2:
37  %cs2 = catchswitch within none [label %catch.body.2] unwind to caller
38
39catch.body.2:
40;Cxx: %catch2 = catchpad within %cs2 [i8* null, i32 u0x40, i8* null]
41;Seh: %catch2 = catchpad within %cs2 [void ()* @dummy_filter]
42  unreachable
43}
44
45; CXX-LABEL: test:
46; CXX-LABEL: $ip2state$test:
47; CXX-NEXT:   .long   .Lfunc_begin0@IMGREL
48; CXX-NEXT:   .long   -1
49; CXX-NEXT:   .long   .Ltmp0@IMGREL+1
50; CXX-NEXT:   .long   1
51; CXX-NEXT:   .long   .Ltmp1@IMGREL+1
52; CXX-NEXT:   .long   -1
53; CXX-NEXT:   .long   "?catch$3@?0?test@4HA"@IMGREL
54; CXX-NEXT:   .long   2
55; CXX-NEXT:   .long   .Ltmp2@IMGREL+1
56; CXX-NEXT:   .long   3
57; CXX-NEXT:   .long   .Ltmp3@IMGREL+1
58; CXX-NEXT:   .long   2
59; CXX-NEXT:   .long   "?catch$5@?0?test@4HA"@IMGREL
60; CXX-NEXT:   .long   4
61
62; SEH-LABEL: test:
63; SEH-LABEL: .Llsda_begin0:
64; SEH-NEXT:    .long   .Ltmp0@IMGREL+1
65; SEH-NEXT:    .long   .Ltmp1@IMGREL+1
66; SEH-NEXT:    .long   dummy_filter@IMGREL
67; SEH-NEXT:    .long   .LBB0_3@IMGREL
68; SEH-NEXT:    .long   .Ltmp0@IMGREL+1
69; SEH-NEXT:    .long   .Ltmp1@IMGREL+1
70; SEH-NEXT:    .long   dummy_filter@IMGREL
71; SEH-NEXT:    .long   .LBB0_5@IMGREL
72; SEH-NEXT:    .long   .Ltmp2@IMGREL+1
73; SEH-NEXT:    .long   .Ltmp3@IMGREL+1
74; SEH-NEXT:    .long   "?dtor$2@?0?test@4HA"@IMGREL
75; SEH-NEXT:    .long   0
76; SEH-NEXT:    .long   .Ltmp2@IMGREL+1
77; SEH-NEXT:    .long   .Ltmp3@IMGREL+1
78; SEH-NEXT:    .long   dummy_filter@IMGREL
79; SEH-NEXT:    .long   .LBB0_5@IMGREL
80; SEH-NEXT:  .Llsda_end0:
81