2018-06-12 11:29:39 +08:00
|
|
|
// RUN: %clang_xray -g -fxray-modes=xray-basic,xray-fdr,xray-profiling -o %t %s
|
2018-06-19 15:11:33 +08:00
|
|
|
// RUN: rm -f xray-log.c-test.*
|
[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
llvm-svn: 334262
2018-06-08 12:00:07 +08:00
|
|
|
// RUN: XRAY_OPTIONS=patch_premain=true:verbosity=1:xray_mode=xray-basic %t \
|
|
|
|
// RUN: 2>&1 | FileCheck %s
|
2018-06-19 15:11:33 +08:00
|
|
|
// RUN: rm -f xray-log.c-test.*
|
[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
llvm-svn: 334262
2018-06-08 12:00:07 +08:00
|
|
|
//
|
|
|
|
// 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 '{{.*}}'
|