1# REQUIRES: x86 2# RUN: rm -rf %t; split-file %s %t 3 4## Check that data-in-code information is sorted even if 5## sections are reordered compared to the input order. 6 7# RUN: sed -e s/SYM/_first/ %t/input.s | \ 8# RUN: llvm-mc -filetype=obj --triple=x86_64-apple-darwin -o %t/first.o 9# RUN: sed -e s/SYM/_second/ %t/input.s | \ 10# RUN: llvm-mc -filetype=obj --triple=x86_64-apple-darwin -o %t/second.o 11# RUN: sed -e s/SYM/_third/ %t/input.s | \ 12# RUN: llvm-mc -filetype=obj --triple=x86_64-apple-darwin -o %t/third.o 13# RUN: %lld -dylib -lSystem -order_file %t/order.txt %t/first.o %t/second.o %t/third.o -o %t/out 14# RUN: llvm-objdump --macho --syms %t/out > %t/dump.txt 15# RUN: llvm-objdump --macho --data-in-code %t/out >> %t/dump.txt 16# RUN: FileCheck %s < %t/dump.txt 17 18# CHECK-LABEL: SYMBOL TABLE: 19# CHECK-DAG: [[#%x, SECOND:]] g F __TEXT,__text _second 20# CHECK-DAG: [[#%x, FIRST:]] g F __TEXT,__text _first 21# CHECK-DAG: [[#%x, THIRD:]] g F __TEXT,__text _third 22 23# CHECK-LABEL: Data in code table (3 entries) 24# CHECK-NEXT: offset length kind 25# CHECK-NEXT: 0x[[#%.8x, SECOND]] 4 JUMP_TABLE32 26# CHECK-NEXT: 0x[[#%.8x, FIRST]] 4 JUMP_TABLE32 27# CHECK-NEXT: 0x[[#%.8x, THIRD]] 4 JUMP_TABLE32 28 29#--- order.txt 30_second 31_first 32_third 33 34#--- input.s 35.globl SYM 36SYM: 37.data_region jt32 38.long 0 39.end_data_region 40