summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/xray-instruction-threshold.cpp
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-03-30 22:46:45 +0000
committerDean Michael Berris <dberris@google.com>2017-03-30 22:46:45 +0000
commit504fc2262a347ec9b527a9430dddcb00b265471f (patch)
treeefc9b226dd8a23d86b901a670d43e1466bdaa464 /clang/test/CodeGen/xray-instruction-threshold.cpp
parentbf8f75930590b7d7279c4f0ab9cee3c1e614a669 (diff)
downloadbcm5719-llvm-504fc2262a347ec9b527a9430dddcb00b265471f.tar.gz
bcm5719-llvm-504fc2262a347ec9b527a9430dddcb00b265471f.zip
[XRay][clang] Fix the -fxray-instruction-threshold flag processing
Summary: The refactoring introduced a regression in the flag processing for -fxray-instruction-threshold which causes it to not get passed properly. This change should restore the previous behaviour. Reviewers: rnk, pelikan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31491 llvm-svn: 299126
Diffstat (limited to 'clang/test/CodeGen/xray-instruction-threshold.cpp')
-rw-r--r--clang/test/CodeGen/xray-instruction-threshold.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGen/xray-instruction-threshold.cpp b/clang/test/CodeGen/xray-instruction-threshold.cpp
new file mode 100644
index 00000000000..ad8801a0c16
--- /dev/null
+++ b/clang/test/CodeGen/xray-instruction-threshold.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fxray-instrument -fxray-instruction-threshold=1 -x c++ -std=c++11 -emit-llvm -o - %s -triple x86_64-unknown-linux-gnu | FileCheck %s
+
+int foo() {
+ return 1;
+}
+
+[[clang::xray_never_instrument]] int bar() {
+ return 2;
+}
+
+// CHECK-DAG: define i32 @_Z3foov() #[[THRESHOLD:[0-9]+]] {
+// CHECK-DAG: define i32 @_Z3barv() #[[NEVERATTR:[0-9]+]] {
+// CHECK-DAG: attributes #[[THRESHOLD]] = {{.*}} "xray-instruction-threshold"="1" {{.*}}
+// CHECK-DAG: attributes #[[NEVERATTR]] = {{.*}} "function-instrument"="xray-never" {{.*}}
OpenPOWER on IntegriCloud