diff options
author | Kostya Serebryany <kcc@google.com> | 2018-09-07 00:38:31 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2018-09-07 00:38:31 +0000 |
commit | 8fa9bde1c89db7990d0b74e829eb022afd869658 (patch) | |
tree | afb047dba1f5a74df8c4349a82e2ab795efe9292 /test/hwasan/TestCases | |
parent | a65c89cd52ff937ed1a6b22d9da881944277d3d6 (diff) | |
download | compiler-rt-8fa9bde1c89db7990d0b74e829eb022afd869658.tar.gz |
[hwasan] make the print-memory-usage.c less agressive: do not assume that malloc can't happen before main
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341615 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/hwasan/TestCases')
-rw-r--r-- | test/hwasan/TestCases/print-memory-usage.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/hwasan/TestCases/print-memory-usage.c b/test/hwasan/TestCases/print-memory-usage.c index c38457f65..ed9a96a9a 100644 --- a/test/hwasan/TestCases/print-memory-usage.c +++ b/test/hwasan/TestCases/print-memory-usage.c @@ -36,19 +36,20 @@ void *T4(void *arg) { return NULL; } int main() { __hwasan_enable_allocator_tagging(); + sink = malloc_and_use(10); __hwasan_print_memory_usage(); - // CHECK: HWASAN pid: [[PID:[0-9]*]] rss: {{.*}} threads: 1 stacks: 1024000 thr_aux: {{.*}} stack_depot: 0 uniq_stacks: 0 heap: 0 + // CHECK: HWASAN pid: [[PID:[0-9]*]] rss: {{.*}} threads: 1 stacks: 1024000 thr_aux: {{.*}} stack_depot: {{.*}} uniq_stacks: [[UNIQ_STACKS:[0-9]*]] heap: [[HEAP:[0-9]*]] void *one_meg = malloc_and_use(1 << 20); __hwasan_print_memory_usage(); - // CHECK: HWASAN pid: [[PID]] rss: {{.*}} threads: 1 stacks: 1024000 thr_aux: {{.*}} stack_depot: {{[1-9][0-9]*}} uniq_stacks: 1 heap: 1052672 + // CHECK: HWASAN pid: [[PID]] rss: {{.*}} threads: 1 stacks: 1024000 thr_aux: {{.*}} stack_depot: {{.*}} free(one_meg); __hwasan_print_memory_usage(); - // CHECK: HWASAN pid: [[PID]] rss: {{.*}} threads: 1 stacks: 1024000 thr_aux: {{.*}} stack_depot: {{[1-9][0-9]*}} uniq_stacks: 2 heap: 0 + // CHECK: HWASAN pid: [[PID]] rss: {{.*}} threads: 1 stacks: 1024000 thr_aux: {{.*}} stack_depot: {{.*}} uniq_stacks: {{.*}} heap: [[HEAP]] pthread_t t1, t2, t3, t4; |