2015-06-02 04:10:10 +08:00
|
|
|
; RUN: llvm-as -o %T/main.lto.obj %s
|
|
|
|
; RUN: llvm-as -o %T/foo.lto.obj %S/Inputs/lto-dep.ll
|
|
|
|
; RUN: rm -f %T/foo.lto.lib
|
|
|
|
; RUN: llvm-ar cru %T/foo.lto.lib %T/foo.lto.obj
|
|
|
|
|
|
|
|
; RUN: llc -filetype=obj -o %T/main.obj %s
|
|
|
|
; RUN: llc -filetype=obj -o %T/foo.obj %S/Inputs/lto-dep.ll
|
|
|
|
; RUN: rm -f %T/foo.lib
|
|
|
|
; RUN: llvm-ar cru %T/foo.lib %T/foo.obj
|
|
|
|
|
2015-08-07 00:47:46 +08:00
|
|
|
; RUN: lld-link /out:%T/main.exe /entry:main /include:f2 /subsystem:console %T/main.lto.obj %T/foo.lto.obj
|
2015-06-02 04:10:10 +08:00
|
|
|
; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-11 %s
|
|
|
|
; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-11 %s
|
2015-08-07 00:47:46 +08:00
|
|
|
; 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
|
2015-06-02 04:10:10 +08:00
|
|
|
; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-11 %s
|
|
|
|
; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-11 %s
|
|
|
|
|
2015-08-07 00:47:46 +08:00
|
|
|
; RUN: lld-link /out:%T/main.exe /entry:main /subsystem:console %T/main.obj %T/foo.lto.obj
|
2015-06-02 04:10:10 +08:00
|
|
|
; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-01 %s
|
|
|
|
; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-01 %s
|
2015-08-07 00:47:46 +08:00
|
|
|
; RUN: lld-link /out:%T/main.exe /entry:main /subsystem:console %T/main.obj %T/foo.lto.lib
|
2015-06-02 04:10:10 +08:00
|
|
|
; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-01 %s
|
|
|
|
; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-01 %s
|
|
|
|
|
2015-08-07 00:47:46 +08:00
|
|
|
; RUN: lld-link /out:%T/main.exe /entry:main /subsystem:console %T/main.lto.obj %T/foo.obj
|
2015-06-02 04:10:10 +08:00
|
|
|
; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-10 %s
|
|
|
|
; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-10 %s
|
2015-08-07 00:47:46 +08:00
|
|
|
; RUN: lld-link /out:%T/main.exe /entry:main /subsystem:console %T/main.lto.obj %T/foo.lib
|
2015-06-02 04:10:10 +08:00
|
|
|
; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-10 %s
|
|
|
|
; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-10 %s
|
|
|
|
|
2015-07-09 03:14:33 +08:00
|
|
|
; VERBOSE: foo.lto.lib({{.*}}foo.lto.obj)
|
|
|
|
|
2015-06-02 04:10:10 +08:00
|
|
|
; HEADERS-11: AddressOfEntryPoint: 0x1000
|
|
|
|
; TEXT-11: Disassembly of section .text:
|
|
|
|
; TEXT-11-NEXT: .text:
|
|
|
|
; TEXT-11-NEXT: xorl %eax, %eax
|
|
|
|
; TEXT-11-NEXT: retq
|
2015-06-04 10:12:16 +08:00
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: int3
|
|
|
|
; TEXT-11-NEXT: movl $2, %eax
|
|
|
|
; TEXT-11-NEXT: retq
|
2015-06-02 04:10:10 +08:00
|
|
|
|
2015-06-08 13:00:42 +08:00
|
|
|
; HEADERS-01: AddressOfEntryPoint: 0x2000
|
2015-06-02 04:10:10 +08:00
|
|
|
; TEXT-01: Disassembly of section .text:
|
|
|
|
; TEXT-01-NEXT: .text:
|
|
|
|
; TEXT-01-NEXT: subq $40, %rsp
|
2015-06-09 04:21:28 +08:00
|
|
|
; TEXT-01-NEXT: callq 23
|
2015-06-02 04:10:10 +08:00
|
|
|
; TEXT-01-NEXT: xorl %eax, %eax
|
|
|
|
; TEXT-01-NEXT: addq $40, %rsp
|
|
|
|
; TEXT-01-NEXT: retq
|
|
|
|
; TEXT-01-NEXT: retq
|
2015-06-09 04:21:28 +08:00
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: int3
|
|
|
|
; TEXT-01-NEXT: retq
|
2015-06-02 04:10:10 +08:00
|
|
|
|
2015-06-09 04:21:28 +08:00
|
|
|
; HEADERS-10: AddressOfEntryPoint: 0x2020
|
2015-06-02 04:10:10 +08:00
|
|
|
; TEXT-10: Disassembly of section .text:
|
|
|
|
; TEXT-10-NEXT: .text:
|
|
|
|
; TEXT-10-NEXT: retq
|
2015-06-09 04:21:28 +08:00
|
|
|
; TEXT-10-NEXT: nopw %cs:(%rax,%rax)
|
|
|
|
; TEXT-10-NEXT: retq
|
2015-06-02 04:10:10 +08:00
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: int3
|
|
|
|
; TEXT-10-NEXT: subq $40, %rsp
|
2015-06-09 04:21:28 +08:00
|
|
|
; TEXT-10-NEXT: callq -41
|
2015-06-02 04:10:10 +08:00
|
|
|
; TEXT-10-NEXT: xorl %eax, %eax
|
|
|
|
; TEXT-10-NEXT: addq $40, %rsp
|
|
|
|
; TEXT-10-NEXT: retq
|
|
|
|
|
|
|
|
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-pc-windows-msvc"
|
|
|
|
|
|
|
|
define i32 @main() {
|
|
|
|
call void @foo()
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @foo()
|
2015-06-04 10:12:16 +08:00
|
|
|
|
|
|
|
$f1 = comdat any
|
|
|
|
define i32 @f1() comdat($f1) {
|
|
|
|
ret i32 1
|
|
|
|
}
|
|
|
|
|
|
|
|
$f2 = comdat any
|
|
|
|
define i32 @f2() comdat($f2) {
|
|
|
|
ret i32 2
|
|
|
|
}
|
2015-06-09 04:21:28 +08:00
|
|
|
|
|
|
|
define internal void @internal() {
|
|
|
|
ret void
|
|
|
|
}
|