1 ; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s
3 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-pc-windows-msvc"
6 define void @"\01?f@@YAXXZ"(i1 %B) personality i32 (...)* @__CxxFrameHandler3 {
9 to label %unreachable unwind label %cleanupblock
12 %cleanp = cleanuppad []
14 cleanupret %cleanp unwind label %catch.dispatch
17 %cp = catchpad [i8* null, i32 64, i8* null]
18 to label %catch unwind label %catchendblock
22 catchret %cp to label %try.cont
28 catchendpad unwind to caller
37 declare i32 @__CxxFrameHandler3(...)
39 ; Destructors need CFI but they shouldn't use the .seh_handler directive.
40 ; CHECK: "?dtor$[[cleanup:[0-9]+]]@?0??f@@YAXXZ@4HA":
41 ; CHECK: .seh_proc "?dtor$[[cleanup]]@?0??f@@YAXXZ@4HA"
42 ; CHECK-NOT: .seh_handler __CxxFrameHandler3
43 ; CHECK: LBB0_[[cleanup]]: # %cleanupblock{{$}}
45 ; Emit CFI for pushing RBP.
46 ; CHECK: movq %rdx, 16(%rsp)
48 ; CHECK: .seh_pushreg 5
50 ; Emit CFI for allocating from the stack pointer.
51 ; CHECK: subq $32, %rsp
52 ; CHECK: .seh_stackalloc 32
54 ; FIXME: This looks wrong...
55 ; CHECK: leaq 32(%rsp), %rbp
56 ; CHECK: .seh_setframe 5, 32
58 ; Prologue is done, emit the .seh_endprologue directive.
59 ; CHECK: .seh_endprologue
61 ; Make sure there is a nop after a call if the call precedes the epilogue.
65 ; Don't emit a reference to the LSDA.
66 ; CHECK: .seh_handlerdata
67 ; CHECK-NOT: .long ("$cppxdata$?f@@YAXXZ")@IMGREL
71 ; CHECK: "?catch$[[catch:[0-9]+]]@?0??f@@YAXXZ@4HA":
72 ; CHECK: .seh_proc "?catch$[[catch]]@?0??f@@YAXXZ@4HA"
73 ; CHECK-NEXT: .seh_handler __CxxFrameHandler3, @unwind, @except
74 ; CHECK: LBB0_[[catch]]: # %catch{{$}}
76 ; Emit CFI for pushing RBP.
77 ; CHECK: movq %rdx, 16(%rsp)
79 ; CHECK: .seh_pushreg 5
81 ; Emit CFI for allocating from the stack pointer.
82 ; CHECK: subq $32, %rsp
83 ; CHECK: .seh_stackalloc 32
85 ; FIXME: This looks wrong...
86 ; CHECK: leaq 32(%rsp), %rbp
87 ; CHECK: .seh_setframe 5, 32
89 ; Prologue is done, emit the .seh_endprologue directive.
90 ; CHECK: .seh_endprologue
92 ; Make sure there is at least one instruction after a call before the epilogue.
94 ; CHECK-NEXT: leaq .LBB0_{{[0-9]+}}(%rip), %rax
96 ; Emit a reference to the LSDA.
97 ; CHECK: .seh_handlerdata
98 ; CHECK-NEXT: .long ("$cppxdata$?f@@YAXXZ")@IMGREL
100 ; CHECK: .seh_endproc