summaryrefslogtreecommitdiff
path: root/test/CodeGen/thinlto_backend.ll
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-01-13 00:51:55 +0000
committerDehao Chen <dehao@google.com>2017-01-13 00:51:55 +0000
commit4a54b1e3abdeb0ddb914c6f22e040f1c422a32a9 (patch)
tree2a37b11ed01460575dee1f8ceb1e41d51b295a32 /test/CodeGen/thinlto_backend.ll
parent85570ac22c7c3bbbf5ff871f0bef822133bf111c (diff)
downloadclang-4a54b1e3abdeb0ddb914c6f22e040f1c422a32a9.tar.gz
Pass -fprofile-sample-use to lto backends.
Summary: LTO backend will not invoke SampleProfileLoader pass even if -fprofile-sample-use is specified. This patch passes the flag down so that pass manager can add the SampleProfileLoader pass correctly. Reviewers: mehdi_amini, tejohnson Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28588 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/thinlto_backend.ll')
-rw-r--r--test/CodeGen/thinlto_backend.ll4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/CodeGen/thinlto_backend.ll b/test/CodeGen/thinlto_backend.ll
index ac0b3b76ef..b38cae12ee 100644
--- a/test/CodeGen/thinlto_backend.ll
+++ b/test/CodeGen/thinlto_backend.ll
@@ -8,6 +8,10 @@
; RUN: not %clang_cc1 -O2 -o %t1.o -x c %s -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-WARNING
; CHECK-WARNING: error: invalid argument '-fthinlto-index={{.*}}' only allowed with '-x ir'
+; Ensure sample profile pass are passed to backend
+; RUN: %clang_cc1 -emit-obj -O2 -o %t5.o -x ir %t1.o -fthinlto-index=%t.thinlto.bc -fprofile-sample-use=%S/Inputs/pgo-sample.prof -mllvm -debug-pass=Structure 2>&1 | FileCheck %s -check-prefix=CHECK-SAMPLEPGO
+; CHECK-SAMPLEPGO: Sample profile pass
+
; Ensure we get expected error for missing index file
; RUN: %clang -O2 -o %t4.o -x ir %t1.o -c -fthinlto-index=bad.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-ERROR1
; CHECK-ERROR1: Error loading index file 'bad.thinlto.bc'