98 lines · plain
1; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s2 3target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"4target triple = "x86_64-pc-windows-msvc"5 6define void @"\01?f@@YAXXZ"(i1 %B) personality ptr @__CxxFrameHandler3 {7entry:8 invoke void @g()9 to label %unreachable unwind label %cleanupblock10 11cleanupblock:12 %cleanp = cleanuppad within none []13 call void @g() [ "funclet"(token %cleanp) ]14 cleanupret from %cleanp unwind label %catch.dispatch15 16catch.dispatch:17 %cs1 = catchswitch within none [label %catch] unwind to caller18 19catch:20 %cp = catchpad within %cs1 [ptr null, i32 64, ptr null]21 call void @g() [ "funclet"(token %cp) ]22 catchret from %cp to label %try.cont23 24try.cont:25 ret void26 27unreachable:28 unreachable29}30 31 32declare void @g()33 34declare i32 @__CxxFrameHandler3(...)35 36; Destructors need CFI but they shouldn't use the .seh_handler directive.37; CHECK: "?dtor$[[cleanup:[0-9]+]]@?0??f@@YAXXZ@4HA":38; CHECK: .seh_proc "?dtor$[[cleanup]]@?0??f@@YAXXZ@4HA"39; CHECK-NOT: .seh_handler __CxxFrameHandler340; CHECK: LBB0_[[cleanup]]: # %cleanupblock{{$}}41 42; Emit CFI for pushing RBP.43; CHECK: movq %rdx, 16(%rsp)44; CHECK: pushq %rbp45; CHECK: .seh_pushreg %rbp46 47; Emit CFI for allocating from the stack pointer.48; CHECK: subq $32, %rsp49; CHECK: .seh_stackalloc 3250 51; CHECK: leaq 48(%rdx), %rbp52; CHECK-NOT: .seh_setframe53 54; Prologue is done, emit the .seh_endprologue directive.55; CHECK: .seh_endprologue56 57; Make sure there is a nop after a call if the call precedes the epilogue.58; CHECK: callq g59; CHECK-NEXT: nop60; CHECK-NEXT: .seh_startepilogue61 62; Don't emit a reference to the LSDA.63; CHECK: .seh_handlerdata64; CHECK-NOT: .long "$cppxdata$?f@@YAXXZ"@IMGREL65; CHECK-NEXT: .text66; CHECK: .seh_endproc67 68; CHECK: "?catch$[[catch:[0-9]+]]@?0??f@@YAXXZ@4HA":69; CHECK: .seh_proc "?catch$[[catch]]@?0??f@@YAXXZ@4HA"70; CHECK-NEXT: .seh_handler __CxxFrameHandler3, @unwind, @except71; CHECK: LBB0_[[catch]]: # %catch{{$}}72 73; Emit CFI for pushing RBP.74; CHECK: movq %rdx, 16(%rsp)75; CHECK: pushq %rbp76; CHECK: .seh_pushreg %rbp77 78; Emit CFI for allocating from the stack pointer.79; CHECK: subq $32, %rsp80; CHECK: .seh_stackalloc 3281 82; CHECK: leaq 48(%rdx), %rbp83; CHECK-NOT: .seh_setframe84 85; Prologue is done, emit the .seh_endprologue directive.86; CHECK: .seh_endprologue87 88; Make sure there is at least one instruction after a call before the epilogue.89; CHECK: callq g90; CHECK-NEXT: leaq .LBB0_{{[0-9]+}}(%rip), %rax91; CHECK-NEXT: .seh_startepilogue92 93; Emit a reference to the LSDA.94; CHECK: .seh_handlerdata95; CHECK-NEXT: .long "$cppxdata$?f@@YAXXZ"@IMGREL96; CHECK-NEXT: .text97; CHECK: .seh_endproc98