diff options
author | Teresa Johnson <tejohnson@google.com> | 2017-03-31 02:05:15 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2017-03-31 02:05:15 +0000 |
commit | 5ed6c1076107f37c52293e34c03249b2ff096831 (patch) | |
tree | 31fc298e8484cd320ea71e52bb6837b5d1cc9fdc /clang/test/CodeGen/function-sections.c | |
parent | 27e147e471053c9d2a64f30b2c09f8fe2706cdb0 (diff) | |
download | bcm5719-llvm-5ed6c1076107f37c52293e34c03249b2ff096831.tar.gz bcm5719-llvm-5ed6c1076107f37c52293e34c03249b2ff096831.zip |
[ThinLTO] Set up lto::Config properly for codegen in ThinLTO backends
Summary:
This involved refactoring out pieces of
EmitAssemblyHelper::CreateTargetMachine for use in runThinLTOBackend.
Subsumes D31114.
Reviewers: mehdi_amini, pcc
Subscribers: Prazek, cfe-commits
Differential Revision: https://reviews.llvm.org/D31508
llvm-svn: 299152
Diffstat (limited to 'clang/test/CodeGen/function-sections.c')
-rw-r--r-- | clang/test/CodeGen/function-sections.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/test/CodeGen/function-sections.c b/clang/test/CodeGen/function-sections.c index 7994acf4dca..b4a72031cb2 100644 --- a/clang/test/CodeGen/function-sections.c +++ b/clang/test/CodeGen/function-sections.c @@ -9,6 +9,12 @@ // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fdata-sections -o - < %s | FileCheck %s --check-prefix=DATA_SECT // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fno-data-sections -fdata-sections -o - < %s | FileCheck %s --check-prefix=DATA_SECT +// Try again through a clang invocation of the ThinLTO backend. +// RUN: %clang -O2 %s -flto=thin -c -o %t.o +// RUN: llvm-lto -thinlto -o %t %t.o +// RUN: %clang -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -S -ffunction-sections -o - | FileCheck %s --check-prefix=FUNC_SECT +// RUN: %clang -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -S -fdata-sections -o - | FileCheck %s --check-prefix=DATA_SECT + const int hello = 123; void world() {} @@ -22,7 +28,7 @@ void world() {} // FUNC_SECT: section .rodata, // FUNC_SECT: hello: -// DATA_SECT-NOT: section +// DATA_SECT-NOT: .section // DATA_SECT: world: // DATA_SECT: .section .rodata.hello, // DATA_SECT: hello: |