2013-07-30 06:55:39 +08:00
|
|
|
# Verify that lld can handle .lib files. "main.obj" refers "var" and
|
|
|
|
# "fn" defined in "vars.lib".
|
2013-06-18 02:43:13 +08:00
|
|
|
#
|
2013-07-11 16:46:21 +08:00
|
|
|
# RUN: yaml2obj %p/Inputs/vars-main.obj.yaml > %t.obj
|
2013-07-05 18:41:44 +08:00
|
|
|
#
|
2013-09-12 13:09:01 +08:00
|
|
|
# RUN: lld -flavor link /out:%t1 /subsystem:console /entry:main /opt:noref \
|
2013-12-05 10:27:30 +08:00
|
|
|
# RUN: -- %t.obj %p/Inputs/vars.lib
|
|
|
|
# RUN: llvm-objdump -d %t1 | FileCheck -check-prefix=TEXT %s
|
|
|
|
# RUN: llvm-readobj -sections %t1 | FileCheck -check-prefix=SECTION %s
|
2013-07-19 10:18:25 +08:00
|
|
|
#
|
2013-09-12 13:09:01 +08:00
|
|
|
# RUN: lld -flavor link /out:%t1 /subsystem:console /entry:main /opt:noref \
|
2013-12-05 10:27:30 +08:00
|
|
|
# RUN: /libpath:%p/Inputs -- %t.obj vars.lib
|
|
|
|
# RUN: llvm-objdump -d %t1 | FileCheck -check-prefix=TEXT %s
|
|
|
|
# RUN: llvm-readobj -sections %t1 | FileCheck -check-prefix=SECTION %s
|
2013-07-19 11:27:03 +08:00
|
|
|
#
|
2013-09-12 13:09:01 +08:00
|
|
|
# RUN: lld -flavor link /out:%t1 /subsystem:console /entry:main /opt:noref \
|
2013-12-05 10:27:30 +08:00
|
|
|
# RUN: /libpath:%p/Inputs /defaultlib:vars.lib -- %t.obj
|
|
|
|
# RUN: llvm-objdump -d %t1 | FileCheck -check-prefix=TEXT %s
|
|
|
|
# RUN: llvm-readobj -sections %t1 | FileCheck -check-prefix=SECTION %s
|
2013-07-19 12:11:37 +08:00
|
|
|
#
|
2013-07-26 07:20:21 +08:00
|
|
|
# RUN: env LIB=%p/Inputs lld -flavor link /out:%t1 /subsystem:console \
|
2013-12-05 10:27:30 +08:00
|
|
|
# RUN: /opt:noref /entry:main -- %t.obj vars.lib
|
|
|
|
# RUN: llvm-objdump -d %t1 | FileCheck -check-prefix=TEXT %s
|
|
|
|
# RUN: llvm-readobj -sections %t1 | FileCheck -check-prefix=SECTION %s
|
2013-07-19 13:06:20 +08:00
|
|
|
#
|
2013-09-12 13:09:01 +08:00
|
|
|
# RUN: env LINK="/out:%t1 /subsystem:console /entry:main /opt:noref \
|
2013-12-05 10:27:30 +08:00
|
|
|
# RUN: -- %t.obj" lld -flavor link %p/Inputs/vars.lib
|
|
|
|
# RUN: llvm-objdump -d %t1 | FileCheck -check-prefix=TEXT %s
|
|
|
|
# RUN: llvm-readobj -sections %t1 | FileCheck -check-prefix=SECTION %s
|
2013-06-18 02:43:13 +08:00
|
|
|
|
2013-12-05 10:27:30 +08:00
|
|
|
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)
|