aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/WinEH/wineh-noret-cleanup.ll
blob: 7d4d833aa9ba920abd818cca757f9d085dd85afc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
; RUN: sed -e s/.Cxx:// %s | llc -mtriple=x86_64-pc-windows-msvc | FileCheck %s --check-prefix=CXX
; RUN: sed -e s/.Seh:// %s | llc -mtriple=x86_64-pc-windows-msvc | FileCheck %s --check-prefix=SEH

declare i32 @__CxxFrameHandler3(...)
declare i32 @__C_specific_handler(...)
declare void @dummy_filter()

declare void @f(i32)

;Cxx: define void @test() personality i32 (...)* @__CxxFrameHandler3 {
;Seh: define void @test() personality i32 (...)* @__C_specific_handler {
entry:
  invoke void @f(i32 1)
          to label %invoke.cont unwind label %catch.dispatch

catch.dispatch:
  %cs1 = catchswitch within none [label %catch.body] unwind label %catch.dispatch.2

catch.body:
;Cxx: %catch = catchpad within %cs1 [i8* null, i32 u0x40, i8* null]
;Seh: %catch = catchpad within %cs1 [void ()* @dummy_filter]
  invoke void @f(i32 2) [ "funclet"(token %catch) ]
          to label %unreachable unwind label %terminate

terminate:
  %cleanup = cleanuppad within %catch []
  call void @f(i32 3) [ "funclet"(token %cleanup) ]
  unreachable

unreachable:
  unreachable

invoke.cont:
  ret void

catch.dispatch.2:
  %cs2 = catchswitch within none [label %catch.body.2] unwind to caller

catch.body.2:
;Cxx: %catch2 = catchpad within %cs2 [i8* null, i32 u0x40, i8* null]
;Seh: %catch2 = catchpad within %cs2 [void ()* @dummy_filter]
  unreachable
}

; CXX-LABEL: test:
; CXX-LABEL: $ip2state$test:
; CXX-NEXT:   .long   .Lfunc_begin0@IMGREL
; CXX-NEXT:   .long   -1
; CXX-NEXT:   .long   .Ltmp0@IMGREL+1
; CXX-NEXT:   .long   1
; CXX-NEXT:   .long   .Ltmp1@IMGREL+1
; CXX-NEXT:   .long   -1
; CXX-NEXT:   .long   "?catch$3@?0?test@4HA"@IMGREL
; CXX-NEXT:   .long   2
; CXX-NEXT:   .long   .Ltmp2@IMGREL+1
; CXX-NEXT:   .long   3
; CXX-NEXT:   .long   .Ltmp3@IMGREL+1
; CXX-NEXT:   .long   2
; CXX-NEXT:   .long   "?catch$5@?0?test@4HA"@IMGREL
; CXX-NEXT:   .long   4

; SEH-LABEL: test:
; SEH-LABEL: .Llsda_begin0:
; SEH-NEXT:    .long   .Ltmp0@IMGREL+1
; SEH-NEXT:    .long   .Ltmp1@IMGREL+1
; SEH-NEXT:    .long   dummy_filter@IMGREL
; SEH-NEXT:    .long   .LBB0_3@IMGREL
; SEH-NEXT:    .long   .Ltmp0@IMGREL+1
; SEH-NEXT:    .long   .Ltmp1@IMGREL+1
; SEH-NEXT:    .long   dummy_filter@IMGREL
; SEH-NEXT:    .long   .LBB0_5@IMGREL
; SEH-NEXT:    .long   .Ltmp2@IMGREL+1
; SEH-NEXT:    .long   .Ltmp3@IMGREL+1
; SEH-NEXT:    .long   "?dtor$2@?0?test@4HA"@IMGREL
; SEH-NEXT:    .long   0
; SEH-NEXT:    .long   .Ltmp2@IMGREL+1
; SEH-NEXT:    .long   .Ltmp3@IMGREL+1
; SEH-NEXT:    .long   dummy_filter@IMGREL
; SEH-NEXT:    .long   .LBB0_5@IMGREL
; SEH-NEXT:  .Llsda_end0: