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
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
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)
23 .cfi_personality 155, _my_personality
24 ## cfi_escape cannot be encoded in compact unwind
29 .subsections_via_symbols
32 .globl _my_personality
35 .cfi_personality 155, _my_personality
36 .cfi_def_cfa_offset 16
43 .subsections_via_symbols