summaryrefslogtreecommitdiff
path: root/test/xray
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2018-06-08 04:00:07 +0000
committerDean Michael Berris <dberris@google.com>2018-06-08 04:00:07 +0000
commit68624e45b595753f69201df2a84dee466b05d968 (patch)
tree5d6be1c1975194a9688a48353d688f2501895c33 /test/xray
parent487ffa731f7ad67612abce33f21b188d08c649cb (diff)
[XRay][compiler-rt] Remove reliance on C++ ABI features
Summary: This fixes http://llvm.org/PR32274. This change adds a test to ensure that we're able to link XRay modes and the runtime to binaries that don't need to depend on the C++ standard library or a C++ ABI library. In particular, we ensure that this will work with C programs compiled+linked with XRay. To make the test pass, we need to change a few things in the XRay runtime implementations to remove the reliance on C++ ABI features. In particular, we change the thread-safe function-local-static initialisation to use pthread_* instead of the C++ features that ensure non-trivial thread-local/function-local-static initialisation. Depends on D47696. Reviewers: dblaikie, jfb, kpw, eizan Reviewed By: kpw Subscribers: echristo, eizan, kpw, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D46998 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334262 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/xray')
-rw-r--r--test/xray/TestCases/Posix/c-test.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/xray/TestCases/Posix/c-test.cc b/test/xray/TestCases/Posix/c-test.cc
new file mode 100644
index 000000000..f8f5775d1
--- /dev/null
+++ b/test/xray/TestCases/Posix/c-test.cc
@@ -0,0 +1,15 @@
+// RUN: %clang_xray -g -o %t %s
+// RUN: rm xray-log.c-test.* || true
+// RUN: XRAY_OPTIONS=patch_premain=true:verbosity=1:xray_mode=xray-basic %t \
+// RUN: 2>&1 | FileCheck %s
+// RUN: rm xray-log.c-test.* || true
+//
+// REQUIRES: x86_64-target-arch
+// REQUIRES: built-in-llvm-tree
+__attribute__((xray_always_instrument)) void always() {}
+
+int main() {
+ always();
+}
+
+// CHECK: =={{[0-9].*}}==XRay: Log file in '{{.*}}'