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 --no-print-imm-hex -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 --no-print-imm-hex -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 --no-print-imm-hex -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 --no-print-imm-hex -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 --no-print-imm-hex -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 --no-print-imm-hex -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:
38 ; TEXT-11-NEXT: <.text>:
39 ; TEXT-11-NEXT: xorl %eax, %eax
54 ; TEXT-11-NEXT: movl $2, %eax
57 ; HEADERS-01: AddressOfEntryPoint: 0x1000
58 ; TEXT-01: Disassembly of section .text:
60 ; TEXT-01-NEXT: <.text>:
61 ; TEXT-01-NEXT: subq $40, %rsp
62 ; TEXT-01-NEXT: callq 0x140001020
63 ; TEXT-01-NEXT: xorl %eax, %eax
64 ; TEXT-01-NEXT: addq $40, %rsp
84 ; HEADERS-10: AddressOfEntryPoint: 0x1020
85 ; TEXT-10: Disassembly of section .text:
87 ; TEXT-10-NEXT: <.text>:
89 ; TEXT-10-NEXT: nopw %cs:(%rax,%rax)
90 ; TEXT-10-NEXT: nopl (%rax,%rax)
107 ; TEXT-10-NEXT: subq $40, %rsp
108 ; TEXT-10-NEXT: callq 0x140001000
109 ; TEXT-10-NEXT: xorl %eax, %eax
110 ; TEXT-10-NEXT: addq $40, %rsp
113 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
114 target triple = "x86_64-pc-windows-msvc"
124 define i32 @f1() comdat($f1) {
129 define i32 @f2() comdat($f2) {
133 define internal void @internal() {