blob: 3e7518344758eee4a3fe0b21553c81b6a770f4ff [file] [log] [blame]
Dean Michael Berris488f7c22018-04-13 02:31:58 +00001// RUN: %clang_cc1 -fxray-instrument -fxray-instrumentation-bundle=none -x c++ \
2// RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \
3// RUN: | FileCheck --check-prefixes CHECK,NOFUNCTION,NOCUSTOM %s
4// RUN: %clang_cc1 -fxray-instrument \
5// RUN: -fxray-instrumentation-bundle=function -x c++ \
6// RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \
7// RUN: | FileCheck --check-prefixes CHECK,FUNCTION,NOCUSTOM %s
8// RUN: %clang_cc1 -fxray-instrument \
9// RUN: -fxray-instrumentation-bundle=custom -x c++ \
10// RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \
11// RUN: | FileCheck --check-prefixes CHECK,NOFUNCTION,CUSTOM %s
12// RUN: %clang_cc1 -fxray-instrument \
13// RUN: -fxray-instrumentation-bundle=function,custom -x c++ \
14// RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \
15// RUN: | FileCheck --check-prefixes CHECK,FUNCTION,CUSTOM %s
16// RUN: %clang_cc1 -fxray-instrument \
17// RUN: -fxray-instrumentation-bundle=function \
18// RUN: -fxray-instrumentation-bundle=custom -x c++ \
19// RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \
20// RUN: | FileCheck --check-prefixes CHECK,FUNCTION,CUSTOM %s
21
22// CHECK: define void @_Z16alwaysInstrumentv() #[[ALWAYSATTR:[0-9]+]] {
23[[clang::xray_always_instrument]] void alwaysInstrument() {
24 static constexpr char kPhase[] = "always";
25 __xray_customevent(kPhase, 6);
26 // CUSTOM: call void @llvm.xray.customevent(i8*{{.*}}, i32 6)
27 // NOCUSTOM-NOT: call void @llvm.xray.customevent(i8*{{.*}}, i32 6)
28}
29
30// FUNCTION: attributes #[[ALWAYSATTR]] = {{.*}} "function-instrument"="xray-always" {{.*}}
31// NOFUNCTION-NOT: attributes #[[ALWAYSATTR]] = {{.*}} "function-instrument"="xray-always" {{.*}}