1 // Make sure we're aligning the stack properly when lowering the custom event
4 // RUN: %clangxx_xray -std=c++11 %s -o %t
5 // RUN: XRAY_OPTIONS="patch_premain=false verbosity=1" \
7 // REQUIRES: x86_64-target-arch
8 // REQUIRES: built-in-llvm-tree
11 #include "xray/xray_interface.h"
13 [[clang::xray_never_instrument
]] __attribute__((weak
)) __m128
f(__m128
*i
) {
17 [[clang::xray_always_instrument
]] void foo() {
18 __xray_customevent(0, 0);
23 [[clang::xray_always_instrument
]] void bar() {
24 __xray_customevent(0, 0);
27 void printer(void* ptr
, size_t size
) {
28 printf("handler called\n");
33 int main(int argc
, char* argv
[]) {
34 __xray_set_customevent_handler(printer
);
36 foo(); // CHECK: handler called
37 bar(); // CHECK: handler called
39 __xray_remove_customevent_handler();