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 |
6 | |
7 | #if __has_feature(address_sanitizer) |
8 | int AddressSanitizerEnabled(); |
9 | #else |
10 | int AddressSanitizerDisabled(); |
11 | #endif |
12 | |
13 | #if __has_feature(hwaddress_sanitizer) |
14 | int HWAddressSanitizerEnabled(); |
15 | #else |
16 | int HWAddressSanitizerDisabled(); |
17 | #endif |
18 | |
19 | // CHECK-ASAN: AddressSanitizerEnabled |
20 | // CHECK-ASAN: HWAddressSanitizerDisabled |
21 | |
22 | // CHECK-HWASAN: AddressSanitizerDisabled |
23 | // CHECK-HWASAN: HWAddressSanitizerEnabled |
24 | |
25 | // CHECK-NO-ASAN: AddressSanitizerDisabled |
26 | // CHECK-NO-ASAN: HWAddressSanitizerDisabled |
27 | |