llvm-project/lld/test/pecoff/importlib.test

39 lines
1.4 KiB
Plaintext
Raw Normal View History

# 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: pushl %ebp
CHECK-NEXT: movl %esp, %ebp
CHECK-NEXT: pushl %esi
CHECK-NEXT: calll *{{[0-9]+}}
CHECK-NEXT: movl {{[0-9]+}}, %ecx
CHECK-NEXT: movl (%ecx), %esi
CHECK-NEXT: addl %eax, %esi
CHECK-NEXT: calll *{{[0-9]+}}
CHECK-NEXT: addl %esi, %eax
CHECK-NEXT: popl %esi
CHECK-NEXT: popl %ebp
CHECK-NEXT: ret