1 ; RUN: llc -mtriple=x86_64-pc-windows-msvc -mattr=+avx < %s | FileCheck %s
3 ; void bar(int a, int b, int c, int d, int e);
6 ; void foo(int a, int b, int c, int d, int e)
8 ; __asm("nop" ::: "bx", "cx", "xmm5", "xmm6", "ymm7");
15 ; __asm("nop" ::: "xmm8");
19 %rtti.TypeDescriptor2 = type { i8**, i8*, [3 x i8] }
21 $"??_R0H@8" = comdat any
23 @"??_7type_info@@6B@" = external constant i8*
24 @"??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat
26 declare dso_local i32 @__CxxFrameHandler3(...)
27 declare dso_local void @"?bar@@YAXHHHHH@Z"(i32, i32, i32, i32, i32)
28 declare dso_local void @"?baz@@YAXH@Z"(i32)
30 define dso_local void @"?foo@@YAXHHHHH@Z"(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
32 %e.addr = alloca i32, align 4
33 %d.addr = alloca i32, align 4
34 %c.addr = alloca i32, align 4
35 %b.addr = alloca i32, align 4
36 %a.addr = alloca i32, align 4
37 store i32 %e, i32* %e.addr, align 4
38 store i32 %d, i32* %d.addr, align 4
39 store i32 %c, i32* %c.addr, align 4
40 store i32 %b, i32* %b.addr, align 4
41 store i32 %a, i32* %a.addr, align 4
42 call void asm sideeffect "nop", "~{bx},~{cx},~{xmm5},~{xmm6},~{ymm7}"()
43 %0 = load i32, i32* %e.addr, align 4
44 %1 = load i32, i32* %d.addr, align 4
45 %2 = load i32, i32* %c.addr, align 4
46 %3 = load i32, i32* %b.addr, align 4
47 %4 = load i32, i32* %a.addr, align 4
48 invoke void @"?bar@@YAXHHHHH@Z"(i32 %4, i32 %3, i32 %2, i32 %1, i32 %0)
49 to label %invoke.cont unwind label %catch.dispatch
51 catch.dispatch: ; preds = %entry
52 %5 = catchswitch within none [label %catch] unwind to caller
54 catch: ; preds = %catch.dispatch
55 %6 = catchpad within %5 [i8* null, i32 64, i8* null]
56 %7 = load i32, i32* %a.addr, align 4
57 call void @"?baz@@YAXH@Z"(i32 %7) [ "funclet"(token %6) ]
58 %8 = load i32, i32* %a.addr, align 4
59 %tobool = icmp ne i32 %8, 0
60 br i1 %tobool, label %if.then, label %if.end
62 if.then: ; preds = %catch
63 call void asm sideeffect "nop", "~{xmm8}"() [ "funclet"(token %6) ]
66 invoke.cont: ; preds = %entry
69 if.end: ; preds = %if.then, %catch
70 catchret from %6 to label %catchret.dest
72 catchret.dest: ; preds = %if.end
75 try.cont: ; preds = %catchret.dest, %invoke.cont
80 ; CHECK: movq %rdx, 16(%rsp)
82 ; CHECK: .seh_pushreg %rbp
84 ; CHECK: .seh_pushreg %rbx
85 ; CHECK: subq $88, %rsp
86 ; CHECK: .seh_stackalloc 88
87 ; CHECK: leaq 112(%rdx), %rbp
88 ; CHECK: vmovaps %xmm8, 48(%rsp)
89 ; CHECK: .seh_savexmm %xmm8, 48
90 ; CHECK: vmovaps %xmm7, 64(%rsp)
91 ; CHECK: .seh_savexmm %xmm7, 64
92 ; CHECK: vmovaps %xmm6, 80(%rsp)
93 ; CHECK: .seh_savexmm %xmm6, 80
94 ; CHECK: .seh_endprologue
95 ; CHECK: movl -{{[0-9]+}}(%rbp), %ecx
96 ; CHECK: vmovaps 80(%rsp), %xmm6
97 ; CHECK: vmovaps 64(%rsp), %xmm7
98 ; CHECK: vmovaps 48(%rsp), %xmm8
99 ; CHECK: leaq .LBB0_1(%rip), %rax
100 ; CHECK: addq $88, %rsp
103 ; CHECK: retq # CATCHRET
105 ; CHECK-LABEL: "$handlerMap$0$?foo@@YAXHHHHH@Z":
106 ; CHECK-NEXT: .long 64 # Adjectives
107 ; CHECK-NEXT: .long 0 # Type
108 ; CHECK-NEXT: .long 0 # CatchObjOffset
109 ; CHECK-NEXT: .long "?catch$2@?0??foo@@YAXHHHHH@Z@4HA"@IMGREL # Handler
111 ; 16 RDX store offset
114 ; CHECK-NEXT: .long 120 # ParentFrameOffset