70 lines · plain
1; RUN: llc -o - %s -mtriple=aarch64-windows | FileCheck %s2; Check that we allocate the unwind help stack object in a fixed location from fp3; so that the runtime can find it when handling an exception4target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"5target triple = "aarch64-pc-windows-msvc19.25.28611"6 7; Check that the store to the unwind help object for func2 is via FP8; CHECK-LABEL: ?func2@@YAXXZ9; CHECK: mov x[[#SCRATCH_REG:]], #-210; CHECK: stur x[[#SCRATCH_REG:]], [x29, #[[#]]]11;12; // struct that requires greater than stack alignment13; struct alignas(32) A14; {15; // data that would be invalid for unwind help (> 0)16; int _x[4]{42, 42, 42, 42};17; ~A() {}18; };19; 20; // cause us to run the funclet in func221; void func3()22; {23; throw 1;24; }25; 26; // the funclet that ensures we have the unwind help correct27; void func2()28; {29; A a;30; func3();31; }32; 33; // function to ensure we are misaligned in func234; void func1()35; {36; func2();37; }38; 39; // set things up and ensure alignment for func140; void test()41; {42; try {43; A a;44; func1();45; } catch(...) {}46; }47 48%struct.A = type { [4 x i32], [16 x i8] }49declare dso_local ptr @"??0A@@QEAA@XZ"(ptr returned %0)50declare dso_local void @"??1A@@QEAA@XZ"(ptr %0)51declare dso_local i32 @__CxxFrameHandler3(...)52declare dso_local void @"?func3@@YAXXZ"()53 54; Function Attrs: noinline optnone uwtable55define dso_local void @"?func2@@YAXXZ"() #0 personality ptr @__CxxFrameHandler3 {56 %1 = alloca %struct.A, align 3257 %2 = call ptr @"??0A@@QEAA@XZ"(ptr %1) #358 invoke void @"?func3@@YAXXZ"()59 to label %3 unwind label %460 613: ; preds = %062 call void @"??1A@@QEAA@XZ"(ptr %1) #363 ret void64 654: ; preds = %066 %5 = cleanuppad within none []67 call void @"??1A@@QEAA@XZ"(ptr %1) #3 [ "funclet"(token %5) ]68 cleanupret from %5 unwind to caller69}70