1 // Checks how we print the developer note "hwasan_dev_note_heap_rb_distance".
2 // RUN: %clang_hwasan %s -o %t
3 // RUN: not %run %t 10 2>&1 | FileCheck %s --check-prefix=D10
4 // RUN: not %run %t 42 2>&1 | FileCheck %s --check-prefix=D42
6 // REQUIRES: stable-runtime
10 #include <sanitizer/hwasan_interface.h>
15 int main(int argc
, char **argv
) {
16 __hwasan_enable_allocator_tagging();
17 int distance
= argc
>= 2 ? atoi(argv
[1]) : 1;
18 for (int i
= 0; i
< 100; i
++)
20 for (int i
= 0; i
< 100; i
++)
23 *(int*)p
[distance
] = 0;
26 // D10: hwasan_dev_note_heap_rb_distance: 90 1023
27 // D42: hwasan_dev_note_heap_rb_distance: 58 1023