struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / scott-pointer1.c
blobdc7d61ea66d05d9b039f200adae537d864569715
1 /*
2 Pointer tests
3 */
4 #include <testfwk.h>
6 unsigned int aint0 = 0;
7 unsigned int aint1 = 0;
8 unsigned char achar0 = 0;
9 unsigned char achar1 = 0;
10 unsigned char *acharP = 0;
12 void
13 f1 (unsigned char *ucP)
16 if (ucP == 0)
18 ASSERT(0);
19 return;
22 ASSERT (!(*ucP));
25 void
26 f2 (unsigned int *uiP)
29 if (uiP == 0)
31 ASSERT(0);
32 return;
35 ASSERT (!(*uiP));
39 unsigned char *
40 f3 (void)
43 return &achar0;
46 void
47 testPointer1 (void)
49 f1 (&achar0);
50 f2 (&aint0);
52 acharP = f3 ();
53 ASSERT (!((acharP == 0) || (*acharP)));