Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / data-in-code-section-ordering.s
blob91302a5f99935df249277a4c330b4eec1efae25c
1 # REQUIRES: x86
2 # RUN: rm -rf %t; split-file %s %t
4 ## Check that data-in-code information is sorted even if
5 ## sections are reordered compared to the input order.
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
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
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
29 #--- order.txt
30 _second
31 _first
32 _third
34 #--- input.s
35 .globl SYM
36 SYM:
37 .data_region jt32
38 .long 0
39 .end_data_region