2018-05-12 03:37:08 +08:00
|
|
|
; REQUIRES: x86
|
|
|
|
|
|
|
|
; RUN: opt -module-summary %s -o %t1.o
|
|
|
|
; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
|
|
|
|
|
|
|
|
; Test to ensure that thinlto-index-only with obj-path creates the file.
|
|
|
|
; RUN: rm -f %t4.o
|
[ELF] accept thinlto options without --plugin-opt= prefix
Summary:
When support for ThinLTO was first added to lld, the options that
control it were prefixed with --plugin-opt= for compatibility with
an existing implementation as a linker plugin. This change enables
shorter versions of the options to be used, as follows:
New Existing
-thinlto-emit-imports-files --plugin-opt=thinlto-emit-imports-files
-thinlto-index-only --plugin-opt=thinlto-index-only
-thinlto-index-only= --plugin-opt=thinlto-index-only=
-thinlto-object-suffix-replace= --plugin-opt=thinlto-object-suffix-replace=
-thinlto-prefix-replace= --plugin-opt=thinlto-prefix-replace=
-lto-obj-path= --plugin-opt=obj-path=
The options with the --plugin-opt= prefix have been retained as aliases
for the shorter variants so that they continue to be accepted.
Reviewers: tejohnson, ruiu, espindola
Reviewed By: ruiu
Subscribers: emaste, arichardson, MaskRay, steven_wu, dexonsmith, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67782
llvm-svn: 372798
2019-09-25 09:19:48 +08:00
|
|
|
; RUN: ld.lld --plugin-opt=thinlto-index-only --plugin-opt=obj-path=%t4.o -shared %t1.o %t2.o -o /dev/null
|
2018-05-12 03:37:08 +08:00
|
|
|
; RUN: llvm-readobj -h %t4.o | FileCheck %s
|
2020-01-18 02:13:09 +08:00
|
|
|
; RUN: llvm-nm %t4.o 2>&1 | count 0
|
2018-05-12 03:37:08 +08:00
|
|
|
|
[ELF] accept thinlto options without --plugin-opt= prefix
Summary:
When support for ThinLTO was first added to lld, the options that
control it were prefixed with --plugin-opt= for compatibility with
an existing implementation as a linker plugin. This change enables
shorter versions of the options to be used, as follows:
New Existing
-thinlto-emit-imports-files --plugin-opt=thinlto-emit-imports-files
-thinlto-index-only --plugin-opt=thinlto-index-only
-thinlto-index-only= --plugin-opt=thinlto-index-only=
-thinlto-object-suffix-replace= --plugin-opt=thinlto-object-suffix-replace=
-thinlto-prefix-replace= --plugin-opt=thinlto-prefix-replace=
-lto-obj-path= --plugin-opt=obj-path=
The options with the --plugin-opt= prefix have been retained as aliases
for the shorter variants so that they continue to be accepted.
Reviewers: tejohnson, ruiu, espindola
Reviewed By: ruiu
Subscribers: emaste, arichardson, MaskRay, steven_wu, dexonsmith, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67782
llvm-svn: 372798
2019-09-25 09:19:48 +08:00
|
|
|
; Check that this also works without the --plugin-opt= prefix.
|
|
|
|
; RUN: rm -f %t4.o
|
2020-05-05 05:42:36 +08:00
|
|
|
; RUN: ld.lld --thinlto-index-only --lto-obj-path=%t4.o -shared %t1.o %t2.o -o /dev/null
|
[ELF] accept thinlto options without --plugin-opt= prefix
Summary:
When support for ThinLTO was first added to lld, the options that
control it were prefixed with --plugin-opt= for compatibility with
an existing implementation as a linker plugin. This change enables
shorter versions of the options to be used, as follows:
New Existing
-thinlto-emit-imports-files --plugin-opt=thinlto-emit-imports-files
-thinlto-index-only --plugin-opt=thinlto-index-only
-thinlto-index-only= --plugin-opt=thinlto-index-only=
-thinlto-object-suffix-replace= --plugin-opt=thinlto-object-suffix-replace=
-thinlto-prefix-replace= --plugin-opt=thinlto-prefix-replace=
-lto-obj-path= --plugin-opt=obj-path=
The options with the --plugin-opt= prefix have been retained as aliases
for the shorter variants so that they continue to be accepted.
Reviewers: tejohnson, ruiu, espindola
Reviewed By: ruiu
Subscribers: emaste, arichardson, MaskRay, steven_wu, dexonsmith, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67782
llvm-svn: 372798
2019-09-25 09:19:48 +08:00
|
|
|
; RUN: llvm-readobj -h %t4.o | FileCheck %s
|
|
|
|
|
[LTO] Suppress emission of empty combined module by default
Summary:
That unless the user requested an output object (--lto-obj-path), the an
unused empty combined module is not emitted.
This changed is helpful for some target (ex. RISCV-V) which encoded the
ABI info in IR module flags (target-abi). Empty unused module has no ABI
info so the linker would get the linking error during merging
incompatible ABIs.
Reviewers: tejohnson, espindola, MaskRay
Subscribers: emaste, inglorion, arichardson, hiraditya, simoncook, MaskRay, steven_wu, dexonsmith, PkmX, dang, lenary, s.egerton, luismarques, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78988
2020-04-28 11:04:36 +08:00
|
|
|
;; Ensure lld emits empty combined module if specific obj-path.
|
|
|
|
; RUN: rm -fr %t.dir/objpath && mkdir -p %t.dir/objpath
|
|
|
|
; RUN: ld.lld --plugin-opt=obj-path=%t4.o -shared %t1.o %t2.o -o %t.dir/objpath/a.out --save-temps
|
|
|
|
; RUN: ls %t.dir/objpath/a.out*.lto.* | count 3
|
|
|
|
|
|
|
|
;; Ensure lld does not emit empty combined module in default.
|
|
|
|
; RUN: rm -fr %t.dir/objpath && mkdir -p %t.dir/objpath
|
|
|
|
; RUN: ld.lld %t1.o %t2.o -o %t.dir/objpath/a.out --save-temps
|
|
|
|
; RUN: ls %t.dir/objpath/a.out*.lto.* | count 2
|
|
|
|
|
2020-03-12 13:00:19 +08:00
|
|
|
; CHECK: Format: elf64-x86-64
|
2018-05-12 03:37:08 +08:00
|
|
|
|
2019-09-11 07:15:38 +08:00
|
|
|
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
2018-05-12 03:37:08 +08:00
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
declare void @g(...)
|
|
|
|
|
|
|
|
define void @f() {
|
|
|
|
entry:
|
|
|
|
call void (...) @g()
|
|
|
|
ret void
|
|
|
|
}
|