llvm-project/clang/test/Lexer/has_feature_leak_sanitizer.cpp
Michal Gorny 96f35266a5 [clang] [Basic] Enable __has_feature(leak_sanitizer)
Add a 'leak_sanitizer' feature akin to existing '*_sanitizer' features
to let programmers switch code paths accounting for leak sanitizers
being enabled.

Differential Revision: https://reviews.llvm.org/D67719

llvm-svn: 372527
2019-09-22 20:55:01 +00:00

12 lines
343 B
C++

// RUN: %clang_cc1 -E -fsanitize=leak %s -o - | FileCheck --check-prefix=CHECK-LSAN %s
// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-LSAN %s
#if __has_feature(leak_sanitizer)
int LeakSanitizerEnabled();
#else
int LeakSanitizerDisabled();
#endif
// CHECK-LSAN: LeakSanitizerEnabled
// CHECK-NO-LSAN: LeakSanitizerDisabled