]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/symbol-ordering-file-icf.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / symbol-ordering-file-icf.s
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3 # RUN: echo "zed" > %t.order
4 # RUN: echo "bar" >> %t.order
5 # RUN: echo "foo" >> %t.order
6 # RUN: ld.lld --icf=all --symbol-ordering-file %t.order -shared %t.o -o %t.so
7 # RUN: llvm-nm %t.so | FileCheck %s
8
9 ## Check that after ICF merges 'foo' and 'zed' we still
10 ## place them before 'bar', in according to ordering file.
11 # CHECK-DAG: 0000000000001000 T foo
12 # CHECK-DAG: 0000000000001000 T zed
13 # CHECK-DAG: 0000000000001004 T bar
14
15 .section .text.foo,"ax",@progbits
16 .align 4
17 .global foo
18 foo:
19   retq
20
21 .section .text.bar,"ax",@progbits
22 .align 4
23 .global bar
24 bar:
25   nop
26   retq
27
28 .section .text.zed,"ax",@progbits
29 .align 4
30 .global zed
31 zed:
32   retq