gcc/testsuite/gcc.c-torture/compile/memtst.c
raw| 1 | /* { dg-add-options stack_size } */ |
| 2 | |
| 3 | #ifdef STACK_SIZE |
| 4 | #define SIZE STACK_SIZE / 8 |
| 5 | #else |
| 6 | #define SIZE 65536 |
| 7 | #endif |
| 8 | |
| 9 | void |
| 10 | memtst (int *p, int a) |
| 11 | { |
| 12 | do |
| 13 | { |
| 14 | if (p[a] == 1) |
| 15 | break; |
| 16 | } |
| 17 | while (--a); |
| 18 | } |
| 19 | |
| 20 | int |
| 21 | main (void) |
| 22 | { |
| 23 | int a[SIZE]; |
| 24 | int i; |
| 25 | __builtin_bzero (a, SIZE * 4); |
| 26 | for (i = 0; i < 100; i++) |
| 27 | { |
| 28 | memtst (a, SIZE); |
| 29 | } |
| 30 | } |