2018-05-12 03:37:08 +08:00
|
|
|
; REQUIRES: x86
|
|
|
|
|
|
|
|
; Basic ThinLTO tests.
|
|
|
|
; RUN: opt -module-summary %s -o %t1.o
|
|
|
|
; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
|
|
|
|
; RUN: opt -module-summary %p/Inputs/thinlto_empty.ll -o %t3.o
|
|
|
|
|
|
|
|
; Ensure lld writes linked files to linked objects file
|
[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=%t.idx -shared %t1.o %t2.o %t3.o -o /dev/null
|
2018-05-12 03:37:08 +08:00
|
|
|
; RUN: FileCheck %s < %t.idx
|
|
|
|
; CHECK: {{.*}}thinlto-index-file.ll.tmp1.o
|
|
|
|
; CHECK: {{.*}}thinlto-index-file.ll.tmp2.o
|
|
|
|
; CHECK: {{.*}}thinlto-index-file.ll.tmp3.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
|
|
|
; Check that this also works without the --plugin-opt= prefix.
|
|
|
|
; RUN: ld.lld -thinlto-index-only=%t.idx -shared %t1.o %t2.o %t3.o -o /dev/null
|
|
|
|
; RUN: FileCheck %s < %t.idx
|
|
|
|
|
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
|
|
|
|
}
|