47 lines · plain
1# REQUIRES: x86, aarch642 3# RUN: rm -rf %t; split-file %s %t4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 %t/strong.s -o %t/strong_x86_64.o5# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 %t/weak.s -o %t/weak_x86_64.o6# RUN: %lld -dylib -dead_strip %t/strong_x86_64.o %t/weak_x86_64.o -o %t/libstrongweak_x86_64.dylib7# RUN: llvm-dwarfdump --eh-frame %t/libstrongweak_x86_64.dylib | FileCheck --check-prefixes CHECK,X86_64 %s8# RUN: %lld -dylib -dead_strip %t/weak_x86_64.o %t/strong_x86_64.o -o %t/libweakstrong_x86_64.dylib9# RUN: llvm-dwarfdump --eh-frame %t/libweakstrong_x86_64.dylib | FileCheck --check-prefixes CHECK,X86_64 %s10 11# RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos11.0 %t/strong.s -o %t/strong_arm64.o12# RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos11.0 %t/weak.s -o %t/weak_arm64.o13# RUN: %lld -arch arm64 -dylib -dead_strip %t/strong_arm64.o %t/weak_arm64.o -o %t/libstrongweak_arm64.dylib14# RUN: llvm-dwarfdump --eh-frame %t/libstrongweak_arm64.dylib | FileCheck --check-prefixes CHECK,ARM64 %s15# RUN: %lld -arch arm64 -dylib -dead_strip %t/weak_arm64.o %t/strong_arm64.o -o %t/libweakstrong_arm64.dylib16# RUN: llvm-dwarfdump --eh-frame %t/libweakstrong_arm64.dylib | FileCheck --check-prefixes CHECK,ARM64 %s17 18## Verify that unneeded FDEs (and their CIEs) are dead-stripped even if they19## point to a live symbol (e.g. because we had multiple weak definitions).20 21# CHECK: .eh_frame contents:22# X86_64: 00000000 00000014 00000000 CIE23# X86_64: 00000018 0000001c 0000001c FDE cie=0000000024# ARM64: 00000000 00000010 00000000 CIE25# ARM64: 00000014 00000018 00000018 FDE cie=0000000026# CHECK-NOT: CIE27# CHECK-NOT: FDE28 29#--- strong.s30.globl _fun31_fun:32 .cfi_startproc33 ## cfi_escape cannot be encoded in compact unwind34 .cfi_escape 035 ret36 .cfi_endproc37 38#--- weak.s39.globl _fun40.weak_definition _fun41_fun:42 .cfi_startproc43 ## cfi_escape cannot be encoded in compact unwind44 .cfi_escape 045 ret46 .cfi_endproc47