llvm-project
43 строки · 1.3 Кб
1# REQUIRES: x86
2# RUN: rm -rf %t; split-file %s %t
3# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 -emit-compact-unwind-non-canonical=true %t/eh-frame.s -o %t/eh-frame.o
4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 -emit-compact-unwind-non-canonical=true %t/cu.s -o %t/cu.o
5# RUN: %lld -dylib %t/cu.o %t/eh-frame.o -o %t/out
6
7## Sanity check: we want our input to contain a section (and not symbol)
8## relocation for the personality reference.
9# RUN: llvm-readobj --relocations %t/cu.o | FileCheck %s --check-prefix=SECT-RELOC
10# SECT-RELOC: Section __compact_unwind {
11# SECT-RELOC-NEXT: __text
12# SECT-RELOC-NEXT: __text
13# SECT-RELOC-NEXT: }
14
15## Verify that the personality referenced via a symbol reloc in eh-frame.s gets
16## dedup'ed with the personality referenced via a section reloc in cu.s.
17# RUN: llvm-objdump --macho --unwind-info %t/out | FileCheck %s
18# CHECK: Personality functions: (count = 1)
19
20#--- eh-frame.s
21_fun:
22.cfi_startproc
23.cfi_personality 155, _my_personality
24## cfi_escape cannot be encoded in compact unwind
25.cfi_escape 0
26ret
27.cfi_endproc
28
29.subsections_via_symbols
30
31#--- cu.s
32.globl _my_personality
33_fun:
34.cfi_startproc
35.cfi_personality 155, _my_personality
36.cfi_def_cfa_offset 16
37ret
38.cfi_endproc
39
40_my_personality:
41nop
42
43.subsections_via_symbols
44