2016-12-14 12:56:42 +08:00
|
|
|
; RUN: opt -module-hash -module-summary %s -o %t.bc
|
|
|
|
; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.bc
|
|
|
|
|
|
|
|
; Check that the generating object files is working without cache
|
|
|
|
; RUN: rm -Rf %t.thin.out
|
|
|
|
; RUN: llvm-lto -thinlto-save-objects=%t.thin.out -thinlto-action=run %t2.bc %t.bc -exported-symbol=main
|
|
|
|
; RUN: ls %t.thin.out | count 2
|
|
|
|
|
|
|
|
; Same with cache
|
|
|
|
; RUN: rm -Rf %t.thin.out
|
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
|
|
|
; RUN: llvm-lto -thinlto-save-objects=%t.thin.out -thinlto-action=run %t2.bc %t.bc -exported-symbol=main -thinlto-cache-dir %t.cache
|
|
|
|
; RUN: ls %t.thin.out | count 2
|
|
|
|
; RUN: ls %t.cache | count 3
|
|
|
|
|
|
|
|
; Same with hot cache
|
|
|
|
; RUN: rm -Rf %t.thin.out
|
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
|
|
|
; RUN: llvm-lto -thinlto-save-objects=%t.thin.out -thinlto-action=run %t2.bc %t.bc -exported-symbol=main -thinlto-cache-dir %t.cache
|
|
|
|
; RUN: ls %t.thin.out | count 2
|
|
|
|
; RUN: ls %t.cache | count 3
|
|
|
|
|
[ThinLTO] Adding architecture name into saved object filename
Summary:
For ThinLTOCodegenerator, it has an option to save the object file
outputs into a directory which is essential for debug info. Tools like lldb
and dsymutil will look for these object files for debug info.
On Darwin platform, you can link fat binaries with one single clang
driver invocation like:
$ clang -arch x86_64 -arch i386 -Wl,-object_path_lto,$TMPDIR ...
Unfornately, the output object files for one architecture is going to
overwrite the previous ones and one architecture slice will end up with
no debug info. One example for this is to turn on ThinLTO for sanitizer
dylibs in compiler-rt project.
To fix the issue, add the name for the architecture into the name of the
output object file.
rdar://problem/35482935
Reviewers: tejohnson, bd1976llvm, dexonsmith, JDevlieghere
Reviewed By: dexonsmith
Subscribers: mehdi_amini, aprantl, inglorion, eraman, hiraditya, jkorous, dang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60924
llvm-svn: 359508
2019-04-30 05:39:54 +08:00
|
|
|
; Check the name of object in directory has arch name included.
|
|
|
|
; RUN: ls %t.thin.out | grep x86_64.thinlto.o | count 2
|
|
|
|
|
2016-12-14 12:56:42 +08:00
|
|
|
|
2019-09-11 07:15:38 +08:00
|
|
|
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
2016-12-14 12:56:42 +08:00
|
|
|
target triple = "x86_64-apple-macosx10.11.0"
|
|
|
|
|
|
|
|
define void @globalfunc() #0 {
|
|
|
|
entry:
|
|
|
|
ret void
|
|
|
|
}
|