Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / linux / lsframe1.c
blob9133199a3f3d573119404be0a68f21da17916f49
2 /* Demonstrate Memcheck correctly handling a 64M array on the stack.
3 Requires --max-stackframe=67108884 or above. And since it
4 generates a very large stack, --main-stacksize=67200000
5 (approximately) is also required. */
7 #include <stdio.h>
9 #define N_MBYTES 64
11 #define N_INTS ((N_MBYTES * 1048576) / sizeof(int))
14 int main ( void )
16 int i, sum;
17 int arr[N_INTS];
18 fprintf(stderr, "lsframe1: start\n");
19 for (i = 0; i < N_INTS; i++)
20 arr[i] = i;
21 sum = 0;
22 for (i = 0; i < N_INTS; i++)
23 sum += arr[i];
24 fprintf(stderr, "lsframe1: done, result is %d\n", sum);
25 return 0;