]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/esan/TestCases/workingset-memset.cpp
1 // RUN: %clang_esan_wset -O0 %s -o %t 2>&1
2 // RUN: %run %t 2>&1 | FileCheck %s
10 int main(int argc
, char **argv
) {
11 const int size
= 128*1024*1024;
12 char *p
= (char *)mmap(0, size
, PROT_READ
| PROT_WRITE
,
13 MAP_ANON
| MAP_PRIVATE
, -1, 0);
14 // Test the slowpath at different cache line boundaries.
15 for (int i
= 0; i
< 630; i
++)
16 memset((char *)p
+ 63*i
, i
, 63*i
);
19 // CHECK: {{.*}} EfficiencySanitizer: the total working set size: 77 KB (12{{[0-9]+}} cache lines)