xref: /llvm-project/clang/test/CodeGen/xray-global-init.cpp (revision bb3111cbaf7b181bcda94415456a69b2a6b767ad)
1*bb3111cbSIan Levesque // RUN: %clang_cc1 -triple=x86_64-linux-gnu -emit-llvm -fxray-instrument -fxray-instruction-threshold=1 %s -o - \
2*bb3111cbSIan Levesque // RUN:   | FileCheck %s
3*bb3111cbSIan Levesque 
4*bb3111cbSIan Levesque struct A {
5*bb3111cbSIan Levesque   A();
6*bb3111cbSIan Levesque   ~A();
7*bb3111cbSIan Levesque };
8*bb3111cbSIan Levesque 
9*bb3111cbSIan Levesque A a;
10*bb3111cbSIan Levesque 
11*bb3111cbSIan Levesque // Check that the xray-instruction-threshold was applied
12*bb3111cbSIan Levesque // CHECK: define internal void @_GLOBAL__sub_I_xray_global_init.cpp() [[NUX:#[0-9]+]] section ".text.startup" {
13*bb3111cbSIan Levesque // CHECK: attributes [[NUX]] = { noinline nounwind {{.*}}"xray-instruction-threshold"="1"{{.*}} }
14