90 lines · plain
1// RUN: llvm-mc -triple x86_64-apple-macosx10.6 -filetype=obj %s -o - | llvm-readobj --sections - | FileCheck %s2 3// We were trying to generate compact unwind info for assembly like this.4// The .cfi_def_cfa directive, however, throws a wrench into that and was5// causing an llvm_unreachable() failure. Make sure the assembler can handle6// the input. The actual eh_frames created using these directives are checked7// elsewhere. This test is a simpler "does the code assemble" check.8 9// rdar://1540651810 11.macro SaveRegisters12 13 push %rbp14 .cfi_def_cfa_offset 1615 .cfi_offset rbp, -1616 17 mov %rsp, %rbp18 .cfi_def_cfa_register rbp19 20 sub $$0x80+8, %rsp21 22 movdqa %xmm0, -0x80(%rbp)23 push %rax24 movdqa %xmm1, -0x70(%rbp)25 push %rdi26 movdqa %xmm2, -0x60(%rbp)27 push %rsi28 movdqa %xmm3, -0x50(%rbp)29 push %rdx30 movdqa %xmm4, -0x40(%rbp)31 push %rcx32 movdqa %xmm5, -0x30(%rbp)33 push %r834 movdqa %xmm6, -0x20(%rbp)35 push %r936 movdqa %xmm7, -0x10(%rbp)37 38.endmacro39.macro RestoreRegisters40 41 movdqa -0x80(%rbp), %xmm042 pop %r943 movdqa -0x70(%rbp), %xmm144 pop %r845 movdqa -0x60(%rbp), %xmm246 pop %rcx47 movdqa -0x50(%rbp), %xmm348 pop %rdx49 movdqa -0x40(%rbp), %xmm450 pop %rsi51 movdqa -0x30(%rbp), %xmm552 pop %rdi53 movdqa -0x20(%rbp), %xmm654 pop %rax55 movdqa -0x10(%rbp), %xmm756 57 leave58 .cfi_def_cfa rsp, 859 .cfi_same_value rbp60 61.endmacro62 63_foo:64.cfi_startproc65 SaveRegisters66 67 RestoreRegisters68 ret69 .cfi_endproc70 71// CHECK: Section {72// CHECK: Index: 173// CHECK: Name: __eh_frame (5F 5F 65 68 5F 66 72 61 6D 65 00 00 00 00 00 00)74// CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)75// CHECK: Address:76// CHECK: Size: 0x4077// CHECK: Offset:78// CHECK: Alignment: 379// CHECK: RelocationOffset: 0x080// CHECK: RelocationCount: 081// CHECK: Type: Coalesced (0xB)82// CHECK: Attributes [ (0x680000)83// CHECK: LiveSupport (0x80000)84// CHECK: NoTOC (0x400000)85// CHECK: StripStaticSyms (0x200000)86// CHECK: ]87// CHECK: Reserved1: 0x088// CHECK: Reserved2: 0x089// CHECK: }90