Dean Michael Berris | 488f7c2 | 2018-04-13 02:31:58 +0000 | [diff] [blame] | 1 | // 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 \ |
Keith Wyss | f437e35 | 2018-04-17 21:32:43 +0000 | [diff] [blame^] | 3 | // RUN: | FileCheck --check-prefixes CHECK,NOFUNCTION,NOCUSTOM,NOTYPED %s |
| 4 | // RUN: %clang_cc1 -fxray-instrument -fxray-instrumentation-bundle=function -x c++ \ |
Dean Michael Berris | 488f7c2 | 2018-04-13 02:31:58 +0000 | [diff] [blame] | 5 | // RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \ |
Keith Wyss | f437e35 | 2018-04-17 21:32:43 +0000 | [diff] [blame^] | 6 | // RUN: | FileCheck --check-prefixes CHECK,FUNCTION,NOCUSTOM,NOTYPED %s |
Dean Michael Berris | 488f7c2 | 2018-04-13 02:31:58 +0000 | [diff] [blame] | 7 | // RUN: %clang_cc1 -fxray-instrument \ |
| 8 | // RUN: -fxray-instrumentation-bundle=custom -x c++ \ |
| 9 | // RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \ |
Keith Wyss | f437e35 | 2018-04-17 21:32:43 +0000 | [diff] [blame^] | 10 | // RUN: | FileCheck --check-prefixes CHECK,NOFUNCTION,CUSTOM,NOTYPED %s |
| 11 | // RUN: %clang_cc1 -fxray-instrument \ |
| 12 | // RUN: -fxray-instrumentation-bundle=typed -x c++ \ |
| 13 | // RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \ |
| 14 | // RUN: | FileCheck --check-prefixes CHECK,NOFUNCTION,NOCUSTOM,TYPED %s |
| 15 | // RUN: %clang_cc1 -fxray-instrument \ |
| 16 | // RUN: -fxray-instrumentation-bundle=custom,typed -x c++ \ |
| 17 | // RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \ |
| 18 | // RUN: | FileCheck --check-prefixes CHECK,NOFUNCTION,CUSTOM,TYPED %s |
Dean Michael Berris | 488f7c2 | 2018-04-13 02:31:58 +0000 | [diff] [blame] | 19 | // RUN: %clang_cc1 -fxray-instrument \ |
| 20 | // RUN: -fxray-instrumentation-bundle=function,custom -x c++ \ |
| 21 | // RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \ |
Keith Wyss | f437e35 | 2018-04-17 21:32:43 +0000 | [diff] [blame^] | 22 | // RUN: | FileCheck --check-prefixes CHECK,FUNCTION,CUSTOM,NOTYPED %s |
| 23 | // RUN: %clang_cc1 -fxray-instrument \ |
| 24 | // RUN: -fxray-instrumentation-bundle=function,typed -x c++ \ |
| 25 | // RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \ |
| 26 | // RUN: | FileCheck --check-prefixes CHECK,FUNCTION,NOCUSTOM,TYPED %s |
| 27 | // RUN: %clang_cc1 -fxray-instrument \ |
| 28 | // RUN: -fxray-instrumentation-bundle=function,custom,typed -x c++ \ |
| 29 | // RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \ |
| 30 | // RUN: | FileCheck --check-prefixes CHECK,FUNCTION,CUSTOM,TYPED %s |
Dean Michael Berris | 488f7c2 | 2018-04-13 02:31:58 +0000 | [diff] [blame] | 31 | // RUN: %clang_cc1 -fxray-instrument \ |
| 32 | // RUN: -fxray-instrumentation-bundle=function \ |
Keith Wyss | f437e35 | 2018-04-17 21:32:43 +0000 | [diff] [blame^] | 33 | // RUN: -fxray-instrumentation-bundle=custom \ |
| 34 | // RUN: -fxray-instrumentation-bundle=typed -x c++ \ |
Dean Michael Berris | 488f7c2 | 2018-04-13 02:31:58 +0000 | [diff] [blame] | 35 | // RUN: -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s \ |
Keith Wyss | f437e35 | 2018-04-17 21:32:43 +0000 | [diff] [blame^] | 36 | // RUN: | FileCheck --check-prefixes CHECK,FUNCTION,CUSTOM,TYPED %s |
Dean Michael Berris | 488f7c2 | 2018-04-13 02:31:58 +0000 | [diff] [blame] | 37 | |
| 38 | // CHECK: define void @_Z16alwaysInstrumentv() #[[ALWAYSATTR:[0-9]+]] { |
| 39 | [[clang::xray_always_instrument]] void alwaysInstrument() { |
| 40 | static constexpr char kPhase[] = "always"; |
| 41 | __xray_customevent(kPhase, 6); |
Keith Wyss | f437e35 | 2018-04-17 21:32:43 +0000 | [diff] [blame^] | 42 | __xray_typedevent(1, kPhase, 6); |
Dean Michael Berris | 488f7c2 | 2018-04-13 02:31:58 +0000 | [diff] [blame] | 43 | // CUSTOM: call void @llvm.xray.customevent(i8*{{.*}}, i32 6) |
| 44 | // NOCUSTOM-NOT: call void @llvm.xray.customevent(i8*{{.*}}, i32 6) |
Keith Wyss | f437e35 | 2018-04-17 21:32:43 +0000 | [diff] [blame^] | 45 | // TYPED: call void @llvm.xray.typedevent(i16 {{.*}}, i8*{{.*}}, i32 6) |
| 46 | // NOTYPED-NOT: call void @llvm.xray.typedevent(i16 {{.*}}, i8*{{.*}}, i32 6) |
Dean Michael Berris | 488f7c2 | 2018-04-13 02:31:58 +0000 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | // FUNCTION: attributes #[[ALWAYSATTR]] = {{.*}} "function-instrument"="xray-always" {{.*}} |
| 50 | // NOFUNCTION-NOT: attributes #[[ALWAYSATTR]] = {{.*}} "function-instrument"="xray-always" {{.*}} |