llvm-project
57 строк · 2.8 Кб
1# RUN: yaml2obj %p/Inputs/export.yaml -o %t-dll.obj
2# RUN: lld-link /out:%t.dll /dll %t-dll.obj /implib:%t-dll.lib \
3# RUN: /export:exportfn1 /export:exportfn2
4# RUN: yaml2obj %p/Inputs/map.yaml -o %t.obj
5# RUN: lld-link /out:%t.exe /entry:main %t.obj %t-dll.lib /map:%T/foo.map /lldmap
6# RUN: FileCheck -check-prefix=MAP -strict-whitespace %s < %T/foo.map
7# RUN: FileCheck -check-prefix=LLDMAP -strict-whitespace %s < %t.map
8# RUN: lld-link /out:%t.exe /entry:main %t.obj %t-dll.lib /map /lldmap:%T/foo-lld.map
9# RUN: FileCheck -check-prefix=MAP -strict-whitespace %s < %t.map
10# RUN: FileCheck -check-prefix=LLDMAP -strict-whitespace %s < %T/foo-lld.map
11# RUN: lld-link /out:%t.dll /dll %t-dll.obj /export:exportfn1 \
12# RUN: /export:foo=exportfn2 /map /mapinfo:exports
13# RUN: FileCheck -check-prefix=MAPINFO -strict-whitespace %s < %t.map
14# RUN: rm -rf %t && mkdir -p %t && cd %t
15# RUN: cp %t.obj map.test.tmp.obj
16# RUN: cp %t-dll.lib map.test.tmp-dll.lib
17# RUN: lld-link /entry:main map.test.tmp.obj map.test.tmp-dll.lib /map
18# RUN: FileCheck -check-prefix=MAP -strict-whitespace %s < map.test.tmp.map
19
20# MAP: {{.*}}
21# MAP-EMPTY:
22# MAP-NEXT: Timestamp is {{.*}}
23# MAP-EMPTY:
24# MAP-NEXT: Preferred load address is 0000000140000000
25# MAP-EMPTY:
26# MAP-NEXT: Start Length Name Class
27# MAP-NEXT: 0001:00000000 00000008H .text CODE
28# MAP-EMPTY:
29# MAP-NEXT: Address Publics by Value Rva+Base Lib:Object
30# MAP-EMPTY:
31# MAP-NEXT: 0000:00000042 absolute 0000000000000042 <absolute>
32# MAP-NEXT: 0001:00000000 main 0000000140001000 map.test.tmp.obj
33# MAP-NEXT: 0001:00000010 exportfn1 0000000140001010 map.test.tmp-dll:map.test.tmp.dll
34# MAP-NEXT: 0001:00000020 exportfn2 0000000140001020 map.test.tmp-dll:map.test.tmp.dll
35# MAP-NEXT: 0002:00000040 __imp_exportfn1 0000000140002040 map.test.tmp-dll:map.test.tmp.dll
36# MAP-NEXT: 0002:00000048 __imp_exportfn2 0000000140002048 map.test.tmp-dll:map.test.tmp.dll
37# MAP-EMPTY:
38# MAP-NEXT: entry point at 0001:00000000
39# MAP-EMPTY:
40# MAP-NEXT: Static symbols
41# MAP-EMPTY:
42# MAP-NEXT: 0001:00000043 staticdef 0000000140001043 map.test.tmp.obj
43
44
45# LLDMAP: Address Size Align Out In Symbol
46# LLDMAP-NEXT: 00001000 00000026 4096 .text
47# LLDMAP-NEXT: 00001000 00000008 4 {{.*}}map.test.tmp.obj:(.text)
48# LLDMAP-NEXT: 00001000 00000000 0 main
49
50# MAPINFO: Exports
51# MAPINFO-EMPTY:
52# MAPINFO-NEXT: ordinal name
53# MAPINFO-EMPTY:
54# MAPINFO-NEXT: 1 exportfn1
55# MAPINFO-NEXT: 2 exportfn3
56# MAPINFO-NEXT: 3 exportfn2
57# MAPINFO-NEXT: exported name: foo
58