1# REQUIRES: asserts 2# RUN: llvm-mc -triple=x86_64-apple-macos10.9 -filetype=obj -o %t %s 3# RUN: llvm-jitlink -noexec %t 4# 5# Verify that PC-begin candidate symbols have been sorted correctly when adding 6# PC-begin edges for FDEs. In this test both _main and _X are at address zero, 7# however we expect to select _main over _X as _X is common. If the sorting 8# fails we'll trigger an assert in EHFrameEdgeFixer, otherwise this test will 9# succeed. 10 11 .section __TEXT,__text,regular,pure_instructions 12 .build_version macos, 12, 0 sdk_version 13, 0 13 .globl _main 14 .p2align 4, 0x90 15_main: 16 .cfi_startproc 17 pushq %rbp 18 .cfi_def_cfa_offset 16 19 .cfi_offset %rbp, -16 20 movq %rsp, %rbp 21 .cfi_def_cfa_register %rbp 22 xorl %eax, %eax 23 popq %rbp 24 retq 25 .cfi_endproc 26 27 .comm _X,4,2 28.subsections_via_symbols 29