]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/archive-elf-forceload.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / archive-elf-forceload.test
1 # Tests the functionality of archive libraries reading
2 # and resolution
3 # Note: The binary files would not be required once we have support to generate
4 # binary archives from textual(yaml) input
5 #
6 # Tests generated using the source files below
7 # main file
8 # int main()
9 # {
10 #   fn();
11 #   return 0;
12 # }
13 #
14 # archive file
15 # int fn()
16 # {
17 #   return 0;
18 # }
19 #
20 # int fn1()
21 # {
22 #   return 0;
23 # }
24 # gcc -c main.c fn.c fn1.c
25
26 RUN: lld -flavor gnu -target x86_64-linux -e main %p/Inputs/mainobj.x86_64 \
27 RUN:  --whole-archive %p/Inputs/libfnarchive.a --no-whole-archive --output-filetype=yaml \
28 RUN:  | FileCheck -check-prefix FORCELOAD %s
29
30 FORCELOAD:  defined-atoms:
31 FORCELOAD:    - name:              fn1
32 FORCELOAD:      scope:             global
33 FORCELOAD:      content:           [ 55, 48, 89, E5, B8, 00, 00, 00, 00, 5D, C3 ]
34 FORCELOAD:    - name:              fn
35 FORCELOAD:      scope:             global
36 FORCELOAD:      content:           [ 55, 48, 89, E5, B8, 00, 00, 00, 00, 5D, C3 ]
37 FORCELOAD:  absolute-atoms:
38 FORCELOAD:    - name:              main.c
39 FORCELOAD:      value:             0x0
40 FORCELOAD:    - name:              fn1.c
41 FORCELOAD:      value:             0x0
42 FORCELOAD:    - name:              fn.c
43 FORCELOAD:      value:             0x0