summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-04 22:11:33 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-04 22:11:33 +0000
commitdad1defd96f21c31ea21e4d4b6f969641fe368f8 (patch)
tree8296a52897371e591d0cef49bf6fa240975d7feb /test
parent316d58822dada9440bd06ecfc758dcc2364d617c (diff)
Notes
Diffstat (limited to 'test')
-rw-r--r--test/xray/TestCases/Linux/argv0-log-file-name.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/xray/TestCases/Linux/argv0-log-file-name.cc b/test/xray/TestCases/Linux/argv0-log-file-name.cc
new file mode 100644
index 0000000000000..1765ce9b5ba1e
--- /dev/null
+++ b/test/xray/TestCases/Linux/argv0-log-file-name.cc
@@ -0,0 +1,14 @@
+// Check to make sure argv[0] is contained within the (randomised) XRay log file
+// name.
+
+// RUN: %clangxx_xray -std=c++11 %s -o %t
+// RUN: %run %t > xray.log.file.name 2>&1
+// RUN: ls | FileCheck xray.log.file.name
+// RUN: rm xray-log.* xray.log.file.name
+
+#include <cstdio>
+#include <libgen.h>
+
+[[clang::xray_always_instrument]] int main(int argc, char *argv[]) {
+ printf("// CHECK: xray-log.%s.{{.*}}\n", basename(argv[0]));
+}