xref: /llvm-project/compiler-rt/test/scudo/stats.c (revision f7c5c0d87b8ae5e55006fd3a31994cd68d64f102)
1*f7c5c0d8SMitch Phillips // RUN: %clang_scudo %s -o %t
2*f7c5c0d8SMitch Phillips // RUN: %run %t 2>&1 | FileCheck %s
3*f7c5c0d8SMitch Phillips 
4*f7c5c0d8SMitch Phillips // Tests that the allocator stats printing function exists and outputs
5*f7c5c0d8SMitch Phillips // "something". Currently that "something" is fairly nebulous, as the 32-bit
6*f7c5c0d8SMitch Phillips // primary doesn't output anything, and for the 64-bit one it's highly dependent
7*f7c5c0d8SMitch Phillips // on the size class map and potential library allocations. So keep it very
8*f7c5c0d8SMitch Phillips // generic for now.
9*f7c5c0d8SMitch Phillips 
10*f7c5c0d8SMitch Phillips #include <stdlib.h>
11*f7c5c0d8SMitch Phillips 
12*f7c5c0d8SMitch Phillips #include <sanitizer/scudo_interface.h>
13*f7c5c0d8SMitch Phillips 
main(int argc,char ** argv)14*f7c5c0d8SMitch Phillips int main(int argc, char **argv) {
15*f7c5c0d8SMitch Phillips   free(malloc(1U));
16*f7c5c0d8SMitch Phillips   __scudo_print_stats();
17*f7c5c0d8SMitch Phillips   return 0;
18*f7c5c0d8SMitch Phillips }
19*f7c5c0d8SMitch Phillips 
20*f7c5c0d8SMitch Phillips // CHECK: Stats:
21