105 lines · plain
1# REQUIRES: x862# Tests to verify that3# - the folded CUEs covered up to the last entries, even if they were removed/folded.4# - only entries that *should* be in eh_frame are actually included. (**)5# (**) This is where LD64 does differently.6 7# RUN: rm -rf %t; split-file %s %t8# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/fold-tail.s -o %t/fold-tail.o9# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/cues-range-gap.s -o %t/cues-range-gap.o10 11# RUN: %lld -o %t/fold-tail.out %t/fold-tail.o12# RUN: llvm-objdump --macho --syms --unwind-info %t/fold-tail.out | FileCheck %s 13 14# RUN: %lld -o %t/cues-range-gap.out %t/cues-range-gap.o15 16# CHECK-LABEL: SYMBOL TABLE:17# CHECK: [[#%x,A_ADDR:]] l F __TEXT,__text _a18# CHECK: [[#%x,B_ADDR:]] l F __TEXT,__text _b19# CHECK: [[#%x,C_ADDR:]] l F __TEXT,__text _c20# CHECK: [[#%x,D_ADDR:]] l F __TEXT,__text _d21# CHECK: [[#%x,MAIN_ADDR:]] g F __TEXT,__text _main22 23## Check that [1] offset starts at c's address + 3 (its length).24# CHECK-LABEL: Contents of __unwind_info section:25# CHECK: Top level indices: (count = 2)26# CHECK-NEXT : [0]: function offset=[[#%#.7x,MAIN_ADDR]]27# CHECK-NEXT : [1]: function offset=[[#%#.7x,C_ADDR + 3]]28 29#--- fold-tail.s30 .text31 .globl _main32 .p2align 4, 0x9033_main:34 .cfi_startproc35 callq _a36 retq37 .cfi_endproc38 39 .p2align 4, 0x9040_a:41 .cfi_startproc42 callq _b43 retq44 .cfi_endproc45 46 .p2align 4, 0x9047_b:48 .cfi_startproc49 callq _c50 retq51 .cfi_endproc52 53 .p2align 4, 0x9054_c:55 .cfi_startproc56 retq57 .cfi_endproc58 59// _d should NOT have an entry in .eh_frame60// So it shouldn't be covered by the unwind table.61_d:62 xorl %eax, %eax63 ret64 65.subsections_via_symbols66 67#--- cues-range-gap.s68 .text69 .globl _main70 .p2align 4, 0x9071_main:72 .cfi_startproc73 callq _a74 retq75 .cfi_endproc76 77 .p2align 4, 0x9078_a:79 .cfi_startproc80 callq _b81 retq82 .cfi_endproc83 84// _d is intentionally placed in between the symbols with eh_frame entries.85// but _d should NOT have an entry in .eh_frame86// So it shouldn't be covered by the unwind table.87_d:88 xorl %eax, %eax89 ret90 91 .p2align 4, 0x9092_b:93 .cfi_startproc94 callq _c95 retq96 .cfi_endproc97 98 .p2align 4, 0x9099_c:100 .cfi_startproc101 retq102 .cfi_endproc103 104.subsections_via_symbols105