[compiler-rt] r341615 - [hwasan] make the print-memory-usage.c less agressive: do not assume that malloc can't happen before main

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 6 17:38:31 PDT 2018


Author: kcc
Date: Thu Sep  6 17:38:31 2018
New Revision: 341615

URL: http://llvm.org/viewvc/llvm-project?rev=341615&view=rev
Log:
[hwasan] make the print-memory-usage.c less agressive: do not assume that malloc can't happen before main

Modified:
    compiler-rt/trunk/test/hwasan/TestCases/print-memory-usage.c

Modified: compiler-rt/trunk/test/hwasan/TestCases/print-memory-usage.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/hwasan/TestCases/print-memory-usage.c?rev=341615&r1=341614&r2=341615&view=diff
==============================================================================
--- compiler-rt/trunk/test/hwasan/TestCases/print-memory-usage.c (original)
+++ compiler-rt/trunk/test/hwasan/TestCases/print-memory-usage.c Thu Sep  6 17:38:31 2018
@@ -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;
 




More information about the llvm-commits mailing list