struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / scott-arrays.c
bloba873653c9e191e2f099e92085e5a38f96a69ff1e
1 /*
2 */
3 #include <testfwk.h>
5 unsigned int aint0 = 0;
6 unsigned int aint1 = 0;
7 unsigned char achar0 = 0;
8 unsigned char achar1 = 0;
10 void
11 bool_or1 (void)
14 ASSERT (!((achar0 > 0) || (achar1 > 0)));
17 void
18 bool_or2 (void)
21 ASSERT (!(achar0 || achar1));
24 void
25 bool_test1 (void)
28 ASSERT (!((achar0 == 0) || achar1));
32 void
33 bool_test2 (void)
36 ASSERT (!((achar0 == 0) || aint0));
39 void
40 bool_and1 (void)
43 ASSERT (!(achar0 && achar1));
46 void
47 bin_or1 (void)
50 char t;
52 t = achar0 | achar1;
53 ASSERT (!(t));
56 void
57 bin_xor1 (void)
60 ASSERT (!(achar0 ^ achar1));
64 void
65 bool_test3 (void)
68 ASSERT (!((achar0 == 0x42) || (achar1 == 42)));
72 void
73 bool_or_lit1 (void)
76 achar0 |= 0x0f;
78 ASSERT (!(achar0 > 0x10));
80 ASSERT (!((achar0 | 0x10) > 0xf0));
84 void
85 bool_and_lit1 (void)
88 achar0 &= 0xf0;
90 ASSERT (!(achar0 > 0x10));
92 ASSERT (!((achar0 & 0x10) > 0xf0));
94 achar0 &= 0xef;
98 void
99 testArrays (void)
102 bool_or1 ();
103 bool_or2 ();
104 bool_and1 ();
105 bin_or1 ();
106 bin_xor1 ();
108 achar0++;
109 bool_and1 ();
110 bool_test1 ();
111 bool_test2 ();
112 bool_test3 ();
115 achar0--;
116 achar1++;
117 bool_and1 ();
119 achar0 = 0;
120 achar1 = 0;
122 bool_or_lit1 ();
123 bool_and_lit1 ();