xref: /llvm-project/clang/test/CodeGen/xray-imbue-arg1.cpp (revision fd739804e0591468762eb87488a497a3f7d4afb0)
1 // RUN: echo "fun:*arg1*=arg1" >> %t.always-instrument
2 // RUN: echo "[always]" > %t.xray-attrlist
3 // RUN: echo "fun:*arg1*=arg1" >> %t.xray-attrlist
4 // RUN: %clang_cc1 -fxray-instrument -x c++ -std=c++11 \
5 // RUN:     -fxray-always-instrument=%t.always-instrument -emit-llvm -o - %s \
6 // RUN:     -triple x86_64-unknown-linux-gnu | FileCheck %s
7 // RUN: %clang_cc1 -fxray-instrument -x c++ -std=c++11 \
8 // RUN:     -fxray-attr-list=%t.xray-attrlist -emit-llvm -o - %s \
9 // RUN:     -triple x86_64-unknown-linux-gnu | FileCheck %s
10 
foo()11 void foo() {}
12 
arg1(void *)13 void arg1(void*) {}
14 
15 // CHECK: define{{.*}} void @_Z3foov() #[[FOO:[0-9]+]] {
16 // CHECK: define{{.*}} void {{.*}}arg1{{.*}} #[[ALWAYSARG1:[0-9]+]] {
17 
18 // CHECK: attributes #[[FOO]] = {{.*}}
19 // CHECK: attributes #[[ALWAYSARG1]] = {{.*}} "function-instrument"="xray-always" {{.*}} "xray-log-args"="1"
20