xref: /aosp_15_r20/external/clang/test/CodeGen/xray-attributes-supported.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple x86_64-unknown-linux-gnu | FileCheck %s
2*67e74705SXin Li 
3*67e74705SXin Li // Make sure that the LLVM attribute for XRay-annotated functions do show up.
foo()4*67e74705SXin Li [[clang::xray_always_instrument]] void foo() {
5*67e74705SXin Li // CHECK: define void @_Z3foov() #0
6*67e74705SXin Li };
7*67e74705SXin Li 
bar()8*67e74705SXin Li [[clang::xray_never_instrument]] void bar() {
9*67e74705SXin Li // CHECK: define void @_Z3barv() #1
10*67e74705SXin Li };
11*67e74705SXin Li 
12*67e74705SXin Li // CHECK: #0 = {{.*}}"function-instrument"="xray-always"
13*67e74705SXin Li // CHECK: #1 = {{.*}}"function-instrument"="xray-never"
14