1 // RUN: %clangxx_hwasan -O0 %s -o %t && %run %t
5 #include <sanitizer/hwasan_interface.h>
10 auto p
= std::make_unique
<char>();
11 std::set
<void *> ptrs
;
12 for (unsigned i
= 0;; ++i
) {
13 void *ptr
= __hwasan_tag_pointer(p
.get(), i
);
14 if (!ptrs
.insert(ptr
).second
)
16 fprintf(stderr
, "%p, %u, %u\n", ptr
, i
, __hwasan_get_tag_from_pointer(ptr
));
17 assert(__hwasan_get_tag_from_pointer(ptr
) == i
);
20 assert(ptrs
.size() == 8 || ptrs
.size() == 64);
22 assert(ptrs
.size() == 256);