llvm-project/clang/test/CodeGen/xray-global-init.cpp
Ian Levesque bb3111cbaf [clang][xray] Add xray attributes to functions without decls too
Summary: This allows instrumenting things like global initializers

Reviewers: dberris, MaskRay, smeenai

Subscribers: cfe-commits, johnislarry

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77191
2020-04-01 00:02:39 -04:00

14 lines
443 B
C++

// RUN: %clang_cc1 -triple=x86_64-linux-gnu -emit-llvm -fxray-instrument -fxray-instruction-threshold=1 %s -o - \
// RUN: | FileCheck %s
struct A {
A();
~A();
};
A a;
// Check that the xray-instruction-threshold was applied
// CHECK: define internal void @_GLOBAL__sub_I_xray_global_init.cpp() [[NUX:#[0-9]+]] section ".text.startup" {
// CHECK: attributes [[NUX]] = { noinline nounwind {{.*}}"xray-instruction-threshold"="1"{{.*}} }