diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index ef56a0114f5..67ebfa2b581 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -1125,6 +1125,7 @@ void ARMAsmPrinter::EmitUnwindingInstruction(const MachineInstr *MI) { Offset = 0; break; case ARM::ADDri: + case ARM::t2ADDri: Offset = -MI->getOperand(2).getImm(); break; case ARM::SUBri: diff --git a/test/CodeGen/Thumb2/emit-unwinding.ll b/test/CodeGen/Thumb2/emit-unwinding.ll new file mode 100644 index 00000000000..1f1ea1b48af --- /dev/null +++ b/test/CodeGen/Thumb2/emit-unwinding.ll @@ -0,0 +1,11 @@ +; RUN: llc -mtriple thumbv7em-apple-unknown-eabi-macho %s -o - -O0 | FileCheck %s + +; CHECK: add.w r11, sp, #{{[1-9]+}} + +define void @foo1() { + call void asm sideeffect "", "~{r4}"() + call void @foo2() + ret void +} + +declare void @foo2()