summaryrefslogtreecommitdiffstats
path: root/lld/test/pecoff/importlib.test
blob: 014bac3afcff950f0923d26ce88eb5df128f8bd8 (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
# 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 /subsystem:console /entry:main /opt:noref \
# RUN:    -- %t.obj %p/Inputs/vars.lib && llvm-objdump -d %t1 | FileCheck %s
#
# RUN: lld -flavor link /out:%t1 /subsystem:console /entry:main /opt:noref \
# RUN:    /libpath:%p/Inputs -- %t.obj vars.lib && llvm-objdump -d %t1 \
# RUN:    | FileCheck %s
#
# RUN: lld -flavor link /out:%t1 /subsystem:console /entry:main /opt:noref \
# RUN:    /libpath:%p/Inputs /defaultlib:vars.lib -- %t.obj \
# RUN:    && llvm-objdump -d %t1 | FileCheck %s
#
# RUN: env LIB=%p/Inputs lld -flavor link /out:%t1 /subsystem:console \
# RUN:    /opt:noref /entry:main -- %t.obj vars.lib \
# RUN:    && llvm-objdump -d %t1 | FileCheck %s
#
# RUN: env LINK="/out:%t1 /subsystem:console /entry:main /opt:noref \
# RUN:    -- %t.obj" lld -flavor link %p/Inputs/vars.lib \
# RUN:    && llvm-objdump -d %t1 | FileCheck %s

CHECK: Disassembly of section .text:
CHECK-NEXT: .text:
CHECK-NEXT:     1000:       55                   pushl   %ebp
CHECK-NEXT:     1001:       8b ec                movl    %esp, %ebp
CHECK-NEXT:     1003:       56                   pushl   %esi
CHECK-NEXT:     1004:       ff 15 78 20 40 00    calll   *4202616
CHECK-NEXT:     100a:       8b 0d 7c 20 40 00    movl    4202620, %ecx
CHECK-NEXT:     1010:       8b 31                movl    (%ecx), %esi
CHECK-NEXT:     1012:       03 f0                addl    %eax, %esi
CHECK-NEXT:     1014:       ff 15 74 20 40 00    calll   *4202612
CHECK-NEXT:     101a:       03 c6                addl    %esi, %eax
CHECK-NEXT:     101c:       5e                   popl    %esi
CHECK-NEXT:     101d:       5d                   popl    %ebp
CHECK-NEXT:     101e:       c3                   ret
OpenPOWER on IntegriCloud