2017-07-19 02:40:50 +08:00
|
|
|
; REQUIRES: x86
|
2017-02-24 07:42:24 +08:00
|
|
|
; RUN: rm -fr %T/thinlto
|
|
|
|
; RUN: mkdir %T/thinlto
|
|
|
|
; RUN: opt -thinlto-bc -o %T/thinlto/main.obj %s
|
|
|
|
; RUN: opt -thinlto-bc -o %T/thinlto/foo.obj %S/Inputs/lto-dep.ll
|
|
|
|
; RUN: lld-link /lldsavetemps /out:%T/thinlto/main.exe /entry:main /subsystem:console %T/thinlto/main.obj %T/thinlto/foo.obj
|
2020-04-16 00:54:22 +08:00
|
|
|
; RUN: llvm-nm %T/thinlto/main.exe.lto.1.obj | FileCheck %s
|
2017-02-24 07:42:24 +08:00
|
|
|
|
2020-03-27 22:20:39 +08:00
|
|
|
; Test various possible options for /opt:lldltojobs
|
|
|
|
; RUN: lld-link /lldsavetemps /out:%T/thinlto/main.exe /entry:main /subsystem:console %T/thinlto/main.obj %T/thinlto/foo.obj /opt:lldltojobs=1
|
2020-04-16 00:54:22 +08:00
|
|
|
; RUN: llvm-nm %T/thinlto/main.exe.lto.1.obj | FileCheck %s
|
2020-03-27 22:20:39 +08:00
|
|
|
; RUN: lld-link /lldsavetemps /out:%T/thinlto/main.exe /entry:main /subsystem:console %T/thinlto/main.obj %T/thinlto/foo.obj /opt:lldltojobs=all
|
2020-04-16 00:54:22 +08:00
|
|
|
; RUN: llvm-nm %T/thinlto/main.exe.lto.1.obj | FileCheck %s
|
2020-04-07 15:52:12 +08:00
|
|
|
; RUN: lld-link /lldsavetemps /out:%T/thinlto/main.exe /entry:main /subsystem:console %T/thinlto/main.obj %T/thinlto/foo.obj /opt:lldltojobs=100
|
2020-04-16 00:54:22 +08:00
|
|
|
; RUN: llvm-nm %T/thinlto/main.exe.lto.1.obj | FileCheck %s
|
2020-03-27 22:20:39 +08:00
|
|
|
; RUN: not lld-link /lldsavetemps /out:%T/thinlto/main.exe /entry:main /subsystem:console %T/thinlto/main.obj %T/thinlto/foo.obj /opt:lldltojobs=foo 2>&1 | FileCheck %s --check-prefix=BAD-JOBS
|
|
|
|
; BAD-JOBS: error: /opt:lldltojobs: invalid job count: foo
|
|
|
|
|
2020-03-04 17:46:31 +08:00
|
|
|
; This command will store full path to foo.obj in the archive %t.lib
|
|
|
|
; Check that /lldsavetemps is still usable in such case.
|
|
|
|
; RUN: lld-link /lib %T/thinlto/foo.obj /out:%t.lib
|
|
|
|
; RUN: lld-link /lldsavetemps /out:%t.exe /entry:main /subsystem:console %T/thinlto/main.obj %t.lib
|
|
|
|
|
2017-02-24 07:42:24 +08:00
|
|
|
; CHECK-NOT: U foo
|
|
|
|
|
2019-09-11 07:15:38 +08:00
|
|
|
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
2017-02-24 07:42:24 +08:00
|
|
|
target triple = "x86_64-pc-windows-msvc"
|
|
|
|
|
|
|
|
define i32 @main() {
|
|
|
|
call void @foo()
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @foo()
|