xref: /llvm-project/llvm/test/MC/X86/compact-unwind-mode-dwarf.s (revision d4bcb45db78dc7ca371224cb01bea8dcb14e0698)
1// RUN: llvm-mc -triple x86_64-apple-macos10.6 -filetype=obj %s -o %t.o
2// RUN: llvm-objdump --macho --unwind-info --dwarf=frames %t.o | FileCheck %s
3
4/// For functions whose unwind info cannot be encoded with compact unwind, make
5/// sure that we encode them using DWARF unwind, and make sure we emit a compact
6/// unwind entry that indicates that a DWARF encoding is being used.
7
8_f:
9  .cfi_startproc
10  ## This encodes DW_CFA_GNU_args_size which cannot be expressed using compact
11  ## unwind, so we must use DWARF unwind instead.
12  .cfi_escape 0x2e, 0x10
13  ret
14  .cfi_endproc
15
16_g:
17  .cfi_startproc
18  ## This encodes DW_CFA_GNU_args_size which cannot be expressed using compact
19  ## unwind, so we must use DWARF unwind instead.
20  .cfi_escape 0x2e, 0x10
21  ret
22  .cfi_endproc
23
24// CHECK: Contents of __compact_unwind section:
25// CHECK:   Entry at offset 0x0:
26// CHECK:     start:                0x[[#%x,F:]] _f
27// CHECK:     length:               0x1
28// CHECK:     compact encoding:     0x04000000
29// CHECK:   Entry at offset 0x20:
30// CHECK:     start:                0x[[#%x,G:]] _g
31// CHECK:     length:               0x1
32// CHECK:     compact encoding:     0x04000000
33
34// CHECK: .eh_frame contents:
35// CHECK: 00000000 00000014 00000000 CIE
36// CHECK:   Format:                DWARF32
37// CHECK:   Version:               1
38// CHECK:   Augmentation:          "zR"
39// CHECK:   Code alignment factor: 1
40// CHECK:   Data alignment factor: -8
41// CHECK:   Return address column: 16
42// CHECK:   Augmentation data:     10
43
44// CHECK: FDE cie=00000000 pc=[[#%.8x,F]]...
45// CHECK:   Format:       DWARF32
46// CHECK:   DW_CFA_GNU_args_size: +16
47
48// CHECK: FDE cie=00000000 pc=[[#%.8x,G]]...
49// CHECK:   Format:       DWARF32
50// CHECK:   DW_CFA_GNU_args_size: +16
51