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
8 #include <sanitizer/hwasan_interface.h>
13 int main(int argc
, char **argv
) {
14 __hwasan_enable_allocator_tagging();
15 int distance
= argc
>= 2 ? atoi(argv
[1]) : 1;
16 for (int i
= 0; i
< 100; i
++)
18 for (int i
= 0; i
< 100; i
++)
21 *(int*)p
[distance
] = 0;
24 // D10: hwasan_dev_note_heap_rb_distance: 90 1023
25 // D42: hwasan_dev_note_heap_rb_distance: 58 1023