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: sub sp, sp, #32
8 ; CHECK-NEXT: stp x29, x30, [sp, #16]
9 ; CHECK-NEXT: add x29, sp, #16
10 ; CHECK-NEXT: mov x1, #-2
11 ; CHECK-NEXT: stur x1, [x29, #-16]
12 ; CHECK-NEXT: cbz w0, .LBB0_2
14 target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"
15 target triple = "aarch64-unknown-windows-msvc19.11.0"
17 ; Function Attrs: uwtable
18 define dso_local void @"?f@@YAXH@Z"(i32 %x) local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
20 %cmp = icmp eq i32 %x, 0
21 br i1 %cmp, label %try.cont, label %if.then
23 if.then: ; preds = %entry
24 invoke void @"?g@@YAXXZ"()
25 to label %try.cont unwind label %catch.dispatch
27 catch.dispatch: ; preds = %if.then
28 %0 = catchswitch within none [label %catch] unwind to caller
30 catch: ; preds = %catch.dispatch
31 %1 = catchpad within %0 [i8* null, i32 64, i8* null]
32 catchret from %1 to label %try.cont
34 try.cont: ; preds = %entry, %if.then, %catch
38 declare dso_local void @"?g@@YAXXZ"() local_unnamed_addr #1
40 declare dso_local i32 @__CxxFrameHandler3(...)