1 ; RUN: llc -mtriple=x86_64-pc-windows-msvc -verify-machineinstrs < %s | FileCheck %s
3 ; We should store -2 into UnwindHelp in a slot immediately after the last XMM
7 declare i32 @__CxxFrameHandler3(...)
9 @fp_global = global double 0.0
11 define void @f() personality ptr @__CxxFrameHandler3 {
12 %v = load double, ptr @fp_global
14 %v1 = fadd double %v, 1.0
15 store double %v1, ptr @fp_global
17 to label %return unwind label %catch.dispatch
23 %cs1 = catchswitch within none [label %catch] unwind to caller
26 %p = catchpad within %cs1 [ptr null, i32 64, ptr null]
27 catchret from %p to label %return
32 ; CHECK: .seh_pushreg %rbp
33 ; CHECK: subq $64, %rsp
34 ; CHECK: .seh_stackalloc 64
35 ; CHECK: leaq 64(%rsp), %rbp
36 ; CHECK: .seh_setframe %rbp, 64
37 ; CHECK: movaps %xmm6, -16(%rbp) # 16-byte Spill
38 ; CHECK: .seh_savexmm %xmm6, 48
39 ; CHECK: .seh_endprologue
40 ; CHECK: movq $-2, -24(%rbp)
41 ; CHECK: movsd fp_global(%rip), %xmm6 # xmm6 = mem[0],zero
43 ; CHECK: addsd __real@3ff0000000000000(%rip), %xmm6
44 ; CHECK: movsd %xmm6, fp_global(%rip)
48 ; CHECK: .LBB{{.*}} # Block address taken
49 ; CHECK: movaps -16(%rbp), %xmm6
50 ; CHECK: addq $64, %rsp
53 ; CHECK: .seh_handlerdata
55 ; CHECK: movq %rdx, 16(%rsp)
57 ; CHECK: .seh_pushreg %rbp
58 ; CHECK: subq $48, %rsp
59 ; CHECK: .seh_stackalloc 48
60 ; CHECK: leaq 64(%rdx), %rbp
61 ; CHECK: movapd %xmm6, 32(%rsp)
62 ; CHECK: .seh_savexmm %xmm6, 32
63 ; CHECK: .seh_endprologue
64 ; CHECK: movapd 32(%rsp), %xmm6
65 ; CHECK: leaq .LBB0_1(%rip), %rax
66 ; CHECK: addq $48, %rsp
68 ; CHECK: retq # CATCHRET