1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3# RUN: echo "SECTIONS { .text : { *(.text.*) } }" > %t.script
4
5# RUN: echo "_bar" > %t.ord
6# RUN: echo "_foo" >> %t.ord
7# RUN: ld.lld --symbol-ordering-file %t.ord -o %t --script %t.script %t.o
8# RUN: llvm-objdump -s %t | FileCheck %s
9
10# CHECK:      Contents of section .rodata:
11# CHECK-NEXT: 02000000 00000000 01000000 00000000
12# CHECK:      Contents of section .text:
13# CHECK-NEXT: 02000000 00000000 01000000 00000000
14
15# RUN: echo "_foo" > %t.ord
16# RUN: echo "_bar" >> %t.ord
17# RUN: ld.lld --symbol-ordering-file %t.ord -o %t --script %t.script %t.o
18# RUN: llvm-objdump -s %t | FileCheck %s --check-prefix=INV
19
20# INV:      Contents of section .rodata:
21# INV-NEXT: 01000000 00000000 02000000 00000000
22# INV:      Contents of section .text:
23# INV-NEXT: 01000000 00000000 02000000 00000000
24
25.section .text.foo,"a",@progbits
26_foo:
27.quad 1
28
29.section .text.bar,"a",@progbits
30_bar:
31.quad 2
32
33.section .rodata.foo,"ao",@progbits,.text.foo
34.quad 1
35
36.section .rodata.bar,"ao",@progbits,.text.bar
37.quad 2
38