1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-pc-windows-msvc %s -o - | FileCheck %s
7 declare dso_local i32 @__CxxFrameHandler3(...)
9 define void @osfx(ptr %this) comdat personality ptr @__CxxFrameHandler3 {
11 ; CHECK: .Lfunc_begin0:
12 ; CHECK-NEXT: .seh_proc osfx
13 ; CHECK-NEXT: .seh_handler __CxxFrameHandler3, @unwind, @except
14 ; CHECK-NEXT: // %bb.0: // %invoke.cont
15 ; CHECK-NEXT: stp x19, x20, [sp, #-64]! // 16-byte Folded Spill
16 ; CHECK-NEXT: .seh_save_regp_x x19, 64
17 ; CHECK-NEXT: str x21, [sp, #16] // 8-byte Folded Spill
18 ; CHECK-NEXT: .seh_save_reg x21, 16
19 ; CHECK-NEXT: stp x29, x30, [sp, #24] // 16-byte Folded Spill
20 ; CHECK-NEXT: .seh_save_fplr 24
21 ; CHECK-NEXT: add x29, sp, #24
22 ; CHECK-NEXT: .seh_add_fp 24
23 ; CHECK-NEXT: .seh_endprologue
24 ; CHECK-NEXT: sub x9, sp, #32
25 ; CHECK-NEXT: and sp, x9, #0xffffffffffffffe0
26 ; CHECK-NEXT: mov x19, sp
27 ; CHECK-NEXT: mov x1, #-2 // =0xfffffffffffffffe
28 ; CHECK-NEXT: mov x20, x0
29 ; CHECK-NEXT: add x8, x19, #0
30 ; CHECK-NEXT: stur x1, [x29, #24]
31 ; CHECK-NEXT: lsr x21, x8, #3
32 ; CHECK-NEXT: adrp x8, osfx
33 ; CHECK-NEXT: add x8, x8, :lo12:osfx
34 ; CHECK-NEXT: str x8, [x0]
35 ; CHECK-NEXT: str wzr, [x21]
36 ; CHECK-NEXT: ldr x0, [x0]
40 ; CHECK-NEXT: // %bb.1: // %invoke.cont12
41 ; CHECK-NEXT: str wzr, [x20]
42 ; CHECK-NEXT: str wzr, [x21]
43 ; CHECK-NEXT: .LBB0_2: // %try.cont
44 ; CHECK-NEXT: $ehgcr_0_2:
45 ; CHECK-NEXT: .seh_startepilogue
46 ; CHECK-NEXT: sub sp, x29, #24
47 ; CHECK-NEXT: .seh_add_fp 24
48 ; CHECK-NEXT: ldp x29, x30, [sp, #24] // 16-byte Folded Reload
49 ; CHECK-NEXT: .seh_save_fplr 24
50 ; CHECK-NEXT: ldr x21, [sp, #16] // 8-byte Folded Reload
51 ; CHECK-NEXT: .seh_save_reg x21, 16
52 ; CHECK-NEXT: ldp x19, x20, [sp], #64 // 16-byte Folded Reload
53 ; CHECK-NEXT: .seh_save_regp_x x19, 64
54 ; CHECK-NEXT: .seh_endepilogue
56 ; CHECK-NEXT: .seh_endfunclet
57 ; CHECK-NEXT: .seh_handlerdata
58 ; CHECK-NEXT: .word ($cppxdata$osfx)@IMGREL
59 ; CHECK-NEXT: .section .text,"xr",discard,osfx
60 ; CHECK-NEXT: .seh_endproc
61 ; CHECK-NEXT: .def "?catch$3@?0?osfx@4HA";
63 ; CHECK-NEXT: .type 32;
65 ; CHECK-NEXT: .p2align 2
66 ; CHECK-NEXT: "?catch$3@?0?osfx@4HA":
67 ; CHECK-NEXT: .seh_proc "?catch$3@?0?osfx@4HA"
68 ; CHECK-NEXT: .seh_handler __CxxFrameHandler3, @unwind, @except
69 ; CHECK-NEXT: .LBB0_3: // %catch
70 ; CHECK-NEXT: stp x19, x20, [sp, #-48]! // 16-byte Folded Spill
71 ; CHECK-NEXT: .seh_save_regp_x x19, 48
72 ; CHECK-NEXT: str x21, [sp, #16] // 8-byte Folded Spill
73 ; CHECK-NEXT: .seh_save_reg x21, 16
74 ; CHECK-NEXT: stp x29, x30, [sp, #24] // 16-byte Folded Spill
75 ; CHECK-NEXT: .seh_save_fplr 24
76 ; CHECK-NEXT: .seh_endprologue
77 ; CHECK-NEXT: adrp x0, .LBB0_2
78 ; CHECK-NEXT: add x0, x0, .LBB0_2
79 ; CHECK-NEXT: .seh_startepilogue
80 ; CHECK-NEXT: ldp x29, x30, [sp, #24] // 16-byte Folded Reload
81 ; CHECK-NEXT: .seh_save_fplr 24
82 ; CHECK-NEXT: ldr x21, [sp, #16] // 8-byte Folded Reload
83 ; CHECK-NEXT: .seh_save_reg x21, 16
84 ; CHECK-NEXT: ldp x19, x20, [sp], #48 // 16-byte Folded Reload
85 ; CHECK-NEXT: .seh_save_regp_x x19, 48
86 ; CHECK-NEXT: .seh_endepilogue
89 %MyAlloca2 = alloca [32 x i8], align 32
90 %0 = ptrtoint ptr %MyAlloca2 to i64
91 store i64 ptrtoint (ptr @osfx to i64), ptr %this
92 %1 = lshr exact i64 %0, 3
93 %2 = inttoptr i64 %1 to ptr
95 %vbtable = load ptr, ptr %this
96 %call.i21 = invoke noundef i32 %vbtable(ptr %vbtable)
97 to label %invoke.cont12 unwind label %catch.dispatch
99 invoke.cont12: ; preds = %invoke.cont
100 store i32 0, ptr %this
104 catch.dispatch: ; preds = %invoke.cont
105 %3 = catchswitch within none [label %catch] unwind to caller
107 catch: ; preds = %catch.dispatch
108 %4 = catchpad within %3 [ptr null, i32 64, ptr null]
109 catchret from %4 to label %try.cont
111 try.cont: ; preds = %catch, %invoke.cont12