2 ; RUN: llvm-as -o %T/main.lto.obj %s
3 ; RUN: llvm-as -o %T/foo.lto.obj %S/Inputs/lto-dep.ll
4 ; RUN: rm -f %T/foo.lto.lib
5 ; RUN: llvm-ar cru %T/foo.lto.lib %T/foo.lto.obj
7 ; RUN: llc -filetype=obj -o %T/main.obj %s
8 ; RUN: llc -filetype=obj -o %T/foo.obj %S/Inputs/lto-dep.ll
9 ; RUN: rm -f %T/foo.lib
10 ; RUN: llvm-ar cru %T/foo.lib %T/foo.obj
12 ; RUN: lld-link /out:%T/main.exe /entry:main /include:f2 /subsystem:console %T/main.lto.obj %T/foo.lto.obj
13 ; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-11 %s
14 ; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-11 %s
15 ; RUN: lld-link /out:%T/main.exe /entry:main /include:f2 /subsystem:console %T/main.lto.obj %T/foo.lto.lib /verbose 2>&1 | FileCheck -check-prefix=VERBOSE %s
16 ; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-11 %s
17 ; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-11 %s
19 ; RUN: lld-link /out:%T/main.exe /entry:main /subsystem:console %T/main.obj %T/foo.lto.obj
20 ; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-01 %s
21 ; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-01 %s
22 ; RUN: lld-link /out:%T/main.exe /entry:main /subsystem:console %T/main.obj %T/foo.lto.lib
23 ; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-01 %s
24 ; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-01 %s
26 ; RUN: lld-link /out:%T/main.exe /entry:main /subsystem:console %T/main.lto.obj %T/foo.obj
27 ; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-10 %s
28 ; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-10 %s
29 ; RUN: lld-link /out:%T/main.exe /entry:main /subsystem:console %T/main.lto.obj %T/foo.lib
30 ; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-10 %s
31 ; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-10 %s
33 ; VERBOSE: foo.lto.lib({{.*}}foo.lto.obj)
35 ; HEADERS-11: AddressOfEntryPoint: 0x1000
36 ; TEXT-11: Disassembly of section .text:
37 ; TEXT-11-NEXT: .text:
38 ; TEXT-11-NEXT: xorl %eax, %eax
53 ; TEXT-11-NEXT: movl $2, %eax
56 ; HEADERS-01: AddressOfEntryPoint: 0x1000
57 ; TEXT-01: Disassembly of section .text:
58 ; TEXT-01-NEXT: .text:
59 ; TEXT-01-NEXT: subq $40, %rsp
60 ; TEXT-01-NEXT: callq 23
61 ; TEXT-01-NEXT: xorl %eax, %eax
62 ; TEXT-01-NEXT: addq $40, %rsp
82 ; HEADERS-10: AddressOfEntryPoint: 0x1020
83 ; TEXT-10: Disassembly of section .text:
84 ; TEXT-10-NEXT: .text:
117 ; TEXT-10-NEXT: subq $40, %rsp
118 ; TEXT-10-NEXT: callq -41
119 ; TEXT-10-NEXT: xorl %eax, %eax
120 ; TEXT-10-NEXT: addq $40, %rsp
123 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
124 target triple = "x86_64-pc-windows-msvc"
134 define i32 @f1() comdat($f1) {
139 define i32 @f2() comdat($f2) {
143 define internal void @internal() {