Asynchronous exception support for the prologue means that there can be
multiple .cfi_def_cfa_offset instructions in a single function, which tripped
up an assertion in the compact unwind generator.
In reality the compact unwind format is far too restrictive to represent
asynchronous frames so if we ever wanted that on Darwin we'd fall back to DWARF
(possibly keeping compact unwind around for synchronous users). So the compact
format should continue to represent the synchronous situation, and the
assertion can be removed.
break;
}
case MCCFIInstruction::OpDefCfaOffset: {
- if (StackSize != 0)
- return CU::UNWIND_ARM64_MODE_DWARF;
StackSize = std::abs(Inst.getOffset());
break;
}
--- /dev/null
+; RUN: llc -mtriple=arm64-apple-macosx %s -filetype=obj -o - | llvm-objdump --unwind-info - | FileCheck %s
+
+; CHECK: Contents of __compact_unwind section
+; CHECK: compact encoding: 0x02021010
+
+; 0x02|021|010 => frameless, stack size 0x21 * 16 = 528, x27 & x28 saved
+
+define void @func() {
+ alloca i8, i32 512
+ ret void
+}
// CHECK: Contents of __compact_unwind section:
// CHECK: compact encoding: 0x03000000
-// CHECK: compact encoding: 0x03000000
// CHECK: .eh_frame contents:
// CHECK: DW_CFA_def_cfa: reg1 +32
-// DW_CFA_def_cfa_offset: +32
-// DW_CFA_def_cfa_offset: +64
-
_cfi_dwarf0:
.cfi_startproc
.cfi_def_cfa x1, 32;
.cfi_endproc
-
-_cfi_dwarf1:
- .cfi_startproc
- .cfi_def_cfa_offset 32
- .cfi_def_cfa_offset 64
- .cfi_endproc