[AArch64][GlobalISel] Add disjoint handling for add_and_or_is_add. (#123594)
[llvm-project.git] / compiler-rt / test / xray / TestCases / Posix / arg1-logging-implicit-this.cpp
blob608564e0d129c13ef77d4964f001277fde749820
1 // Intercept the implicit 'this' argument of class member functions.
2 //
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"
10 #include <cassert>
12 class A {
13 public:
14 [[clang::xray_always_instrument, clang::xray_log_args(1)]] void f() {
15 // does nothing.
19 volatile uint64_t captured = 0;
21 void handler(int32_t, XRayEntryType, uint64_t arg1) {
22 captured = arg1;
25 int main() {
26 __xray_set_handler_arg1(handler);
27 A instance;
28 instance.f();
29 __xray_remove_handler_arg1();
30 assert(captured == (uint64_t)&instance);