1 // Test basic new functionality. 2 // RUN: %clangxx_hwasan %s -o %t 3 // RUN: %run %t 4 5 #include <stdlib.h> 6 #include <assert.h> 7 #include <sanitizer/hwasan_interface.h> 8 #include <sanitizer/allocator_interface.h> 9 main()10int main() { 11 __hwasan_enable_allocator_tagging(); 12 13 size_t volatile n = 0; 14 char *a1 = new char[n]; 15 assert(a1 != nullptr); 16 assert(__sanitizer_get_allocated_size(a1) == 0); 17 delete[] a1; 18 } 19