2 ## Regression test for https://github.com/llvm/llvm-project/issues/63039
4 ## Use an old version to ensure we do *not* have any compact-unwind.
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos9 %s -o %t.o
7 ## Pre-cond: smoke-check that there is really no compact-unwind entries - only dwarfs.
8 # RUN: llvm-objdump --macho --unwind-info --dwarf=frames %t.o | FileCheck %s --check-prefix=PRE
9 # PRE-NOT: Contents of __compact_unwind section:
10 # PRE-NOT: Entry at offset
11 # PRE: .eh_frame contents:
12 # PRE: {{[0-9a-f]+}} {{.*}} CIE
13 # PRE: Format: DWARF32
16 ## Link should succeed (ie., not crashed due to bug in icf code).
17 # RUN: %lld -lSystem -lc++ --icf=all -arch x86_64 -arch x86_64 -platform_version macos 11.0 11.0 %t.o -o %t.out
19 ## Post-cond: verify that the final binary has expected eh-frame contents.
20 # RUN: llvm-objdump --macho --syms --dwarf=frames %t.out | FileCheck %s --check-prefix=POST
21 # POST-LABEL: SYMBOL TABLE:
22 # POST: [[#%x,EXCEPT_ADDR:]] l O __TEXT,__gcc_except_tab GCC_except_table0
23 # POST: [[#%x,EXCEPT_ADDR]] l O __TEXT,__gcc_except_tab GCC_except_table1
24 # POST: [[#%.16x,F0_ADDR:]] g F __TEXT,__text _f0
25 # POST: [[#%.16x,F1_ADDR:]] g F __TEXT,__text _f1
26 # POST: [[#%.16x,G_ADDR:]] g F __TEXT,__text _g
28 # POST-LABEL: .eh_frame contents:
29 # POST: {{.*}} FDE cie={{.+}} pc=[[#%x,G_ADDR]]...{{.+}}
31 # POST: {{.*}} FDE cie={{.+}} pc=[[#%x,F0_ADDR]]...{{.+}}
32 # POST: Format: DWARF32
33 # POST: LSDA Address: [[#%.16x,EXCEPT_ADDR]]
35 # POST: {{.*}} FDE cie={{.+}} pc=[[#%x,F1_ADDR]]...{{.+}}
36 # POST Format: DWARF32
37 # POST LSDA Address: [[#%.16x,EXCEPT_ADDR]]
39 .section __TEXT,__text,regular,pure_instructions
43 .cfi_lsda 16, Lexception0
44 .cfi_def_cfa_offset 16
50 .section __TEXT,__gcc_except_tab
55 .section __TEXT,__text,regular,pure_instructions
59 .cfi_lsda 16, Lexception1
60 .cfi_def_cfa_offset 16
66 .section __TEXT,__gcc_except_tab
71 .section __TEXT,__text,regular,pure_instructions
75 .cfi_def_cfa_offset 16
77 .cfi_def_cfa_register %rbp
81 .section __TEXT,__text,regular,pure_instructions
86 .subsections_via_symbols