1 ; RUN: llc < %s | FileCheck %s
3 ; Make sure the prologue is sane. (Doesn't need to exactly match this,
4 ; but the original issue only reproduced if the cbz was immediately
5 ; after the frame setup.)
7 ; CHECK: stp x29, x30, [sp, #-32]!
8 ; CHECK-NEXT: .seh_save_fplr_x 32
9 ; CHECK-NEXT: mov x29, sp
10 ; CHECK-NEXT: .seh_set_fp
11 ; CHECK-NEXT: .seh_endprologue
12 ; CHECK-NEXT: mov x1, #-2
13 ; CHECK-NEXT: stur x1, [x29, #16]
14 ; CHECK-NEXT: cbz w0, .LBB0_2
16 target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"
17 target triple = "aarch64-unknown-windows-msvc19.11.0"
19 ; Function Attrs: uwtable
20 define dso_local void @"?f@@YAXH@Z"(i32 %x) local_unnamed_addr #0 personality ptr @__CxxFrameHandler3 {
22 %cmp = icmp eq i32 %x, 0
23 br i1 %cmp, label %try.cont, label %if.then
25 if.then: ; preds = %entry
26 invoke void @"?g@@YAXXZ"()
27 to label %try.cont unwind label %catch.dispatch
29 catch.dispatch: ; preds = %if.then
30 %0 = catchswitch within none [label %catch] unwind to caller
32 catch: ; preds = %catch.dispatch
33 %1 = catchpad within %0 [ptr null, i32 64, ptr null]
34 catchret from %1 to label %try.cont
36 try.cont: ; preds = %entry, %if.then, %catch
40 declare dso_local void @"?g@@YAXXZ"() local_unnamed_addr #1
42 declare dso_local i32 @__CxxFrameHandler3(...)