summaryrefslogtreecommitdiffstats
path: root/lld/test/pecoff/importlib.test
blob: ef2ca13d3acccab97187d0ecfe969ad9a5efc4ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Verify that lld can handle .lib files. "main.obj" refers "var" and
# "fn" defined in "vars.lib".
#
# RUN: yaml2obj %p/Inputs/vars-main.obj.yaml > %t.obj
#
# RUN: lld -flavor link /out:%t1.exe /subsystem:console /entry:main /opt:noref \
# RUN:   -- %t.obj %p/Inputs/vars.lib
# RUN: llvm-objdump -d %t1.exe | FileCheck -check-prefix=TEXT %s
# RUN: llvm-readobj -sections %t1.exe | FileCheck -check-prefix=SECTION %s
#
# RUN: lld -flavor link /out:%t2.exe /subsystem:console /entry:main /opt:noref \
# RUN:   /libpath:%p/Inputs -- %t.obj vars.lib
# RUN: llvm-objdump -d %t2.exe | FileCheck -check-prefix=TEXT %s
# RUN: llvm-readobj -sections %t2.exe | FileCheck -check-prefix=SECTION %s
#
# RUN: lld -flavor link /out:%t3.exe /subsystem:console /entry:main /opt:noref \
# RUN:   /libpath:%p/Inputs /defaultlib:vars.lib -- %t.obj
# RUN: llvm-objdump -d %t3.exe | FileCheck -check-prefix=TEXT %s
# RUN: llvm-readobj -sections %t3.exe | FileCheck -check-prefix=SECTION %s
#
# RUN: env LIB=%p/Inputs lld -flavor link /out:%t4.exe /subsystem:console \
# RUN:   /opt:noref /entry:main -- %t.obj vars.lib
# RUN: llvm-objdump -d %t4.exe | FileCheck -check-prefix=TEXT %s
# RUN: llvm-readobj -sections %t4.exe | FileCheck -check-prefix=SECTION %s
#
# RUN: env LINK="/out:%t5.exe /subsystem:console /entry:main /opt:noref \
# RUN:   -- %t.obj" lld -flavor link %p/Inputs/vars.lib
# RUN: llvm-objdump -d %t5.exe | FileCheck -check-prefix=TEXT %s
# RUN: llvm-readobj -sections %t5.exe | FileCheck -check-prefix=SECTION %s

TEXT: Disassembly of section .text:
TEXT-NEXT: .text:
TEXT-NEXT:     pushl   %ebp
TEXT-NEXT:     movl    %esp, %ebp
TEXT-NEXT:     pushl   %esi
TEXT-NEXT:     calll   *{{[0-9]+}}
TEXT-NEXT:     movl    {{[0-9]+}}, %ecx
TEXT-NEXT:     movl    (%ecx), %esi
TEXT-NEXT:     addl    %eax, %esi
TEXT-NEXT:     calll   *{{[0-9]+}}
TEXT-NEXT:     addl    %esi, %eax
TEXT-NEXT:     popl    %esi
TEXT-NEXT:     popl    %ebp
TEXT-NEXT:     ret

SECTION: Name: .idata (2E 69 64 61 74 61 00 00)
OpenPOWER on IntegriCloud