mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 11:35:51 -04:00

This can be used to detect whether the code is being built with XRay instrumentation using the __has_feature(xray_instrument) predicate. Differential Revision: https://reviews.llvm.org/D52159 llvm-svn: 342358
12 lines
351 B
C++
12 lines
351 B
C++
// RUN: %clang_cc1 -E -fxray-instrument %s -o - | FileCheck --check-prefix=CHECK-XRAY %s
|
|
// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-XRAY %s
|
|
|
|
#if __has_feature(xray_instrument)
|
|
int XRayInstrumentEnabled();
|
|
#else
|
|
int XRayInstrumentDisabled();
|
|
#endif
|
|
|
|
// CHECK-XRAY: XRayInstrumentEnabled
|
|
// CHECK-NO-XRAY: XRayInstrumentDisabled
|