llvm-for-llvmta/tools/clang/test/Lexer/has_feature_address_sanitiz...

27 lines
948 B
C++
Raw Permalink Normal View History

2022-04-25 13:02:35 +02:00
// RUN: %clang_cc1 -E -fsanitize=address %s -o - | FileCheck --check-prefix=CHECK-ASAN %s
// RUN: %clang_cc1 -E -fsanitize=kernel-address %s -o - | FileCheck --check-prefix=CHECK-ASAN %s
// RUN: %clang_cc1 -E -fsanitize=hwaddress %s -o - | FileCheck --check-prefix=CHECK-HWASAN %s
// RUN: %clang_cc1 -E -fsanitize=kernel-hwaddress %s -o - | FileCheck --check-prefix=CHECK-HWASAN %s
// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-ASAN %s
#if __has_feature(address_sanitizer)
int AddressSanitizerEnabled();
#else
int AddressSanitizerDisabled();
#endif
#if __has_feature(hwaddress_sanitizer)
int HWAddressSanitizerEnabled();
#else
int HWAddressSanitizerDisabled();
#endif
// CHECK-ASAN: AddressSanitizerEnabled
// CHECK-ASAN: HWAddressSanitizerDisabled
// CHECK-HWASAN: AddressSanitizerDisabled
// CHECK-HWASAN: HWAddressSanitizerEnabled
// CHECK-NO-ASAN: AddressSanitizerDisabled
// CHECK-NO-ASAN: HWAddressSanitizerDisabled