aboutsummaryrefslogtreecommitdiff
path: root/test/xray/TestCases/Posix/optional-inmemory-log.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/xray/TestCases/Posix/optional-inmemory-log.cc')
-rw-r--r--test/xray/TestCases/Posix/optional-inmemory-log.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/xray/TestCases/Posix/optional-inmemory-log.cc b/test/xray/TestCases/Posix/optional-inmemory-log.cc
new file mode 100644
index 000000000000..feaaa4124750
--- /dev/null
+++ b/test/xray/TestCases/Posix/optional-inmemory-log.cc
@@ -0,0 +1,23 @@
+// Make sure that we don't get the inmemory logging implementation enabled when
+// we turn it off via options.
+
+// RUN: %clangxx_xray -std=c++11 %s -o %t
+// RUN: XRAY_OPTIONS="patch_premain=true verbosity=1 xray_naive_log=false xray_logfile_base=optional-inmemory-log.xray-" %run %t 2>&1 | FileCheck %s
+//
+// Make sure we clean out the logs in case there was a bug.
+//
+// RUN: rm -f optional-inmemory-log.xray-*
+
+// UNSUPPORTED: target-is-mips64,target-is-mips64el
+
+#include <cstdio>
+
+[[clang::xray_always_instrument]] void foo() {
+ printf("foo() is always instrumented!");
+}
+
+int main() {
+ // CHECK-NOT: XRay: Log file in 'optional-inmemory-log.xray-{{.*}}'
+ foo();
+ // CHECK: foo() is always instrumented!
+}