2 ## Check that section ordering follows from input file ordering.
3 # RUN: rm -rf %t; split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/1.s -o %t/1.o
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/2.s -o %t/2.o
6 # RUN: %lld -dylib %t/1.o %t/2.o -o %t/12
7 # RUN: %lld -dylib %t/2.o %t/1.o -o %t/21
8 # RUN: %lld -dylib %t/2.o %t/1.o -o %t/synth-section-order \
9 # RUN: -add_empty_section __TEXT __objc_stubs \
10 # RUN: -add_empty_section __TEXT __init_offsets \
11 # RUN: -add_empty_section __TEXT __stubs \
12 # RUN: -add_empty_section __TEXT __stub_helper \
13 # RUN: -add_empty_section __TEXT __unwind_info \
14 # RUN: -add_empty_section __TEXT __eh_frame \
15 # RUN: -add_empty_section __DATA __objc_selrefs
16 # RUN: llvm-objdump --macho --section-headers %t/12 | FileCheck %s --check-prefix=CHECK-12
17 # RUN: llvm-objdump --macho --section-headers %t/21 | FileCheck %s --check-prefix=CHECK-21
18 # RUN: llvm-objdump --macho --section-headers %t/synth-section-order | FileCheck %s --check-prefix=CHECK-SYNTHETIC-ORDER
23 # CHECK-12-NEXT: __cstring
26 ## `foo` always sorts next to `__text` since it's a code section
27 ## and needs to be adjacent for arm64 thunk calculations
29 # CHECK-21-NEXT: __cstring
32 # CHECK-SYNTHETIC-ORDER: __text
33 # CHECK-SYNTHETIC-ORDER-NEXT: foo
34 # CHECK-SYNTHETIC-ORDER-NEXT: __stubs
35 # CHECK-SYNTHETIC-ORDER-NEXT: __stub_helper
36 # CHECK-SYNTHETIC-ORDER-NEXT: __objc_stubs
37 # CHECK-SYNTHETIC-ORDER-NEXT: __init_offsets
38 # CHECK-SYNTHETIC-ORDER-NEXT: __cstring
39 # CHECK-SYNTHETIC-ORDER-NEXT: bar
40 # CHECK-SYNTHETIC-ORDER-NEXT: __unwind_info
41 # CHECK-SYNTHETIC-ORDER-NEXT: __eh_frame
42 # CHECK-SYNTHETIC-ORDER-NEXT: __objc_selrefs
57 .section __TEXT,foo,regular,pure_instructions