HWASAN_FLAG(bool, random_tags, true, "")
HWASAN_FLAG(
- int, max_malloc_fill_size, 0x1000, // By default, fill only the first 4K.
+ int, max_malloc_fill_size, 0,
"HWASan allocator flag. max_malloc_fill_size is the maximal amount of "
"bytes that will be filled with malloc_fill_byte on malloc.")
// Check that we fill malloc-ed memory correctly.
// RUN: %clangxx_hwasan %s -o %t
-// RUN: %run %t | FileCheck %s
+// RUN: %run %t | FileCheck %s --check-prefix=CHECK-0
+// RUN: %env_hwasan_opts=max_malloc_fill_size=20 %run %t | FileCheck %s --check-prefix=CHECK-20-be
+// RUN: %env_hwasan_opts=max_malloc_fill_size=0:malloc_fill_byte=8 %run %t | FileCheck %s --check-prefix=CHECK-0
// RUN: %env_hwasan_opts=max_malloc_fill_size=10:malloc_fill_byte=8 %run %t | FileCheck %s --check-prefix=CHECK-10-8
// RUN: %env_hwasan_opts=max_malloc_fill_size=20:malloc_fill_byte=171 %run %t | FileCheck %s --check-prefix=CHECK-20-ab
delete [] x;
}
-// CHECK: -bebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebe-
+// CHECK-0: -000000000000000000000000000000000000000000000000000000000000000000-
+// CHECK-20-be: -bebebebebebebebebebebebebebebebebebebebe00000000000000000000000000-
// CHECK-10-8: -080808080808080808080000000000000000000000000000000000000000000000-
// CHECK-20-ab: -abababababababababababababababababababab00000000000000000000000000-