]>
git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/scudo/random_shuffle.cpp
1 // RUN: %clang_scudo %s -o %t
2 // RUN: rm -rf %T/random_shuffle_tmp_dir
3 // RUN: mkdir %T/random_shuffle_tmp_dir
4 // RUN: %run %t 100 > %T/random_shuffle_tmp_dir/out1
5 // RUN: %run %t 100 > %T/random_shuffle_tmp_dir/out2
6 // RUN: %run %t 10000 > %T/random_shuffle_tmp_dir/out1
7 // RUN: %run %t 10000 > %T/random_shuffle_tmp_dir/out2
8 // RUN: not diff %T/random_shuffle_tmp_dir/out?
9 // RUN: rm -rf %T/random_shuffle_tmp_dir
10 // UNSUPPORTED: i386-linux,i686-linux,arm-linux,armhf-linux
12 // Tests that the allocator shuffles the chunks before returning to the user.
17 int main(int argc
, char **argv
) {
18 int alloc_size
= argc
== 2 ? atoi(argv
[1]) : 100;
19 char *base
= new char[alloc_size
];
20 for (int i
= 0; i
< 20; i
++) {
21 char *p
= new char[alloc_size
];
22 printf("%zd\n", base
- p
);