[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Lexer / has_feature_address_sanitizer.cpp
blobf8ae3643279ba7e16862c303d2c1a5651084c5a3
1 // RUN: %clang_cc1 -E -fsanitize=address %s -o - | FileCheck --check-prefix=CHECK-ASAN %s
2 // RUN: %clang_cc1 -E -fsanitize=kernel-address %s -o - | FileCheck --check-prefix=CHECK-ASAN %s
3 // RUN: %clang_cc1 -E -fsanitize=hwaddress %s -o - | FileCheck --check-prefix=CHECK-HWASAN %s
4 // RUN: %clang_cc1 -E -fsanitize=kernel-hwaddress %s -o - | FileCheck --check-prefix=CHECK-HWASAN %s
5 // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-ASAN %s
7 #if __has_feature(address_sanitizer)
8 int AddressSanitizerEnabled();
9 #else
10 int AddressSanitizerDisabled();
11 #endif
13 #if __has_feature(hwaddress_sanitizer)
14 int HWAddressSanitizerEnabled();
15 #else
16 int HWAddressSanitizerDisabled();
17 #endif
19 // CHECK-ASAN: AddressSanitizerEnabled
20 // CHECK-ASAN: HWAddressSanitizerDisabled
22 // CHECK-HWASAN: AddressSanitizerDisabled
23 // CHECK-HWASAN: HWAddressSanitizerEnabled
25 // CHECK-NO-ASAN: AddressSanitizerDisabled
26 // CHECK-NO-ASAN: HWAddressSanitizerDisabled