summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/thinlto_backend.ll
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2018-04-17 16:39:25 +0000
committerTeresa Johnson <tejohnson@google.com>2018-04-17 16:39:25 +0000
commit9e4321c12d6a097742419ea4e2c458e1f21734bf (patch)
tree804284227dca56f34a5f1ed462c66ea213138e12 /clang/test/CodeGen/thinlto_backend.ll
parentc7ff2e9a4fd1736c986eb4fc0cc2c361ea5878f2 (diff)
downloadbcm5719-llvm-9e4321c12d6a097742419ea4e2c458e1f21734bf.tar.gz
bcm5719-llvm-9e4321c12d6a097742419ea4e2c458e1f21734bf.zip
[ThinLTO] Pass -save-temps to LTO backend for distributed ThinLTO builds
Summary: The clang driver option -save-temps was not passed to the LTO config, so when invoking the ThinLTO backends via clang during distributed builds there was no way to get LTO to save temp files. Getting this to work with ThinLTO distributed builds also required changing the driver to avoid a separate compile step to emit unoptimized bitcode when the input was already bitcode under -save-temps. Not only is this unnecessary in general, it is problematic for ThinLTO backends since the temporary bitcode file to the backend would not match the module path in the combined index, leading to incorrect ThinLTO backend index-based optimizations. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D45217 llvm-svn: 330194
Diffstat (limited to 'clang/test/CodeGen/thinlto_backend.ll')
-rw-r--r--clang/test/CodeGen/thinlto_backend.ll12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/test/CodeGen/thinlto_backend.ll b/clang/test/CodeGen/thinlto_backend.ll
index 40530ec5364..5b1964ac7d5 100644
--- a/clang/test/CodeGen/thinlto_backend.ll
+++ b/clang/test/CodeGen/thinlto_backend.ll
@@ -26,8 +26,16 @@
; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t4.o -x ir %t5.o -c -fthinlto-index=%t.thinlto.bc
; RUN: llvm-nm %t4.o | count 0
-; Ensure f2 was imported
-; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc
+; Ensure f2 was imported. Check for all 3 flavors of -save-temps[=cwd|obj].
+; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps=obj
+; RUN: llvm-dis %t1.s.0.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
+; RUN: mkdir -p %T/dir1
+; RUN: (cd %T/dir1 && %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps=cwd)
+; RUN: llvm-dis %T/dir1/*1.s.0.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
+; RUN: mkdir -p %T/dir2
+; RUN: (cd %T/dir2 && %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps)
+; RUN: llvm-dis %T/dir2/*1.s.0.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
+; CHECK-IMPORT: define available_externally void @f2()
; RUN: llvm-nm %t3.o | FileCheck --check-prefix=CHECK-OBJ %s
; CHECK-OBJ: T f1
; CHECK-OBJ-NOT: U f2
OpenPOWER on IntegriCloud