re PR target/78594 (Bug in November 11th, 2016 change to rs6000.md)
[official-gcc.git] / boehm-gc / testsuite / boehm-gc.c / leak_test.c
blobbf563ac1c16c0301d94dbfe59cae10774e0ee111
1 #include "leak_detector.h"
3 int main() {
4 int *p[10];
5 int i;
6 GC_find_leak = 1; /* for new collect versions not compiled */
7 /* with -DFIND_LEAK. */
8 for (i = 0; i < 10; ++i) {
9 p[i] = malloc(sizeof(int)+i);
11 CHECK_LEAKS();
12 for (i = 1; i < 10; ++i) {
13 free(p[i]);
15 for (i = 0; i < 9; ++i) {
16 p[i] = malloc(sizeof(int)+i);
18 CHECK_LEAKS();
19 CHECK_LEAKS();
20 CHECK_LEAKS();
21 return 0;