diff --git a/lib/Target/XCore/XCoreFrameLowering.cpp b/lib/Target/XCore/XCoreFrameLowering.cpp index c60259d13f2..d4075e073bd 100644 --- a/lib/Target/XCore/XCoreFrameLowering.cpp +++ b/lib/Target/XCore/XCoreFrameLowering.cpp @@ -93,6 +93,10 @@ void XCoreFrameLowering::emitPrologue(MachineFunction &MF) const { XCoreFunctionInfo *XFI = MF.getInfo(); DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc(); + if (MFI->getMaxAlignment() > getStackAlignment()) + report_fatal_error("emitPrologue unsupported alignment: " + + Twine(MFI->getMaxAlignment())); + bool FP = hasFP(MF); const AttributeSet &PAL = MF.getFunction()->getAttributes(); diff --git a/test/CodeGen/XCore/alignment.ll b/test/CodeGen/XCore/alignment.ll new file mode 100644 index 00000000000..28bdf3b7420 --- /dev/null +++ b/test/CodeGen/XCore/alignment.ll @@ -0,0 +1,9 @@ +; RUN: not llc < %s -march=xcore 2>&1 | FileCheck %s + +; CHECK: emitPrologue unsupported alignment: 8 +define void @f() nounwind { +entry: + %BadAlignment = alloca i64, align 8 + ret void +} +