summaryrefslogtreecommitdiff
path: root/testsuite/tests/rts/T10904lib.c
blob: bfed67b695cc7f6ac9010861ecfedc27423fdf3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <stdlib.h>


#define MAGIC 0x11223344

void
init_value(int * p)
{
    *p = MAGIC;
}


void
finalize_value(int * p)
{
    static long counter = 0;

    counter += 1;

    if (counter % 1000000 == 0) {
        fprintf(stderr, "finalize_value: %ld calls\n", counter);
    }

    if (*p != MAGIC) {
        fprintf(stderr, "finalize_value: %x != %x after %ld calls\n",
                *p, MAGIC, counter);
        abort();
    }
}