summaryrefslogtreecommitdiff
path: root/test/Integration
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-08-24 21:37:33 +0000
committerDehao Chen <dehao@google.com>2017-08-24 21:37:33 +0000
commit9619ec9a5eb42ebc8f71c933a919df08dfd90f86 (patch)
treea7680df770d84e12a03a54cb4c907d72bc0b3e3c /test/Integration
parent9448f422a1cf7f06fc904bc2d74dbbed5bfe6972 (diff)
Expose -mllvm -accurate-sample-profile to clang.
Summary: With accurate sample profile, we can do more aggressive size optimization. For some size-critical application, this can reduce the text size by 20% Reviewers: davidxl, rsmith Reviewed By: davidxl, rsmith Subscribers: mehdi_amini, eraman, sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D37091 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311707 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Integration')
-rw-r--r--test/Integration/thinlto_profile_sample_accurate.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Integration/thinlto_profile_sample_accurate.c b/test/Integration/thinlto_profile_sample_accurate.c
new file mode 100644
index 0000000000..d7966c215c
--- /dev/null
+++ b/test/Integration/thinlto_profile_sample_accurate.c
@@ -0,0 +1,9 @@
+// Test to ensure -emit-llvm profile-sample-accurate is honored in ThinLTO.
+// RUN: %clang -O2 %s -flto=thin -fprofile-sample-accurate -c -o %t.o
+// RUN: llvm-lto -thinlto -o %t %t.o
+// RUN: %clang_cc1 -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -emit-llvm -o - | FileCheck %s
+
+// CHECK: define void @foo()
+// CHECK: attributes {{.*}} "profile-sample-accurate"
+void foo() {
+}