1 // Intercept the implicit 'this' argument of class member functions.
3 // RUN: %clangxx_xray -g -std=c++11 %s -o %t
4 // RUN: rm -f log-args-this-*
5 // RUN: env XRAY_OPTIONS="patch_premain=true verbosity=1 xray_logfile_base=log-args-this-" %run %t
7 // REQUIRES: target={{(aarch64|x86_64)-.*}}
9 #include "xray/xray_interface.h"
14 [[clang::xray_always_instrument
, clang::xray_log_args(1)]] void f() {
19 volatile uint64_t captured
= 0;
21 void handler(int32_t, XRayEntryType
, uint64_t arg1
) {
26 __xray_set_handler_arg1(handler
);
29 __xray_remove_handler_arg1();
30 assert(captured
== (uint64_t)&instance
);