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 ; CHECK: leaq 48(%rdx), %rbp
55 ; CHECK-NOT: .seh_setframe
57 ; Prologue is done, emit the .seh_endprologue directive.
58 ; CHECK: .seh_endprologue
60 ; Make sure there is a nop after a call if the call precedes the epilogue.
64 ; Don't emit a reference to the LSDA.
65 ; CHECK: .seh_handlerdata
66 ; CHECK-NOT: .long ("$cppxdata$?f@@YAXXZ")@IMGREL
70 ; CHECK: "?catch$[[catch:[0-9]+]]@?0??f@@YAXXZ@4HA":
71 ; CHECK: .seh_proc "?catch$[[catch]]@?0??f@@YAXXZ@4HA"
72 ; CHECK-NEXT: .seh_handler __CxxFrameHandler3, @unwind, @except
73 ; CHECK: LBB0_[[catch]]: # %catch{{$}}
75 ; Emit CFI for pushing RBP.
76 ; CHECK: movq %rdx, 16(%rsp)
78 ; CHECK: .seh_pushreg 5
80 ; Emit CFI for allocating from the stack pointer.
81 ; CHECK: subq $32, %rsp
82 ; CHECK: .seh_stackalloc 32
84 ; CHECK: leaq 48(%rdx), %rbp
85 ; CHECK-NOT: .seh_setframe
87 ; Prologue is done, emit the .seh_endprologue directive.
88 ; CHECK: .seh_endprologue
90 ; Make sure there is at least one instruction after a call before the epilogue.
92 ; CHECK-NEXT: leaq .LBB0_{{[0-9]+}}(%rip), %rax
94 ; Emit a reference to the LSDA.
95 ; CHECK: .seh_handlerdata
96 ; CHECK-NEXT: .long ("$cppxdata$?f@@YAXXZ")@IMGREL