Imported Upstream version 2.9.0
[debian/cc1111] / support / regression / tests / stacks.c
1 /*
2   size: 126, 127, 128, 129
3  */
4 #include <testfwk.h>
5
6 void
7 spoil(char a)
8 {
9   UNUSED(a);
10 }
11
12 void
13 spoilPtr(volatile char *p)
14 {
15   UNUSED(p);
16 }
17
18 void
19 testStack(void)
20 {
21   volatile char above;
22   volatile char above2;
23 #ifndef __mcs51
24   volatile char ac[{size}];
25 #else
26   volatile char ac[{size} - 100];
27 #endif
28   volatile char below;
29   volatile char * volatile p;
30
31   spoil(ac[0]);
32   spoilPtr(&above);
33   spoilPtr(&below);
34
35   p = &above2;
36   spoilPtr(p);
37 }