struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / scott-bool1.c
blob24e056580308e4262f318dbefc3c278e7992c2e1
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 bool_or1(void)
13 ASSERT(!( (achar0 >0) || (achar1 >0 )));
16 void bool_or2(void)
19 ASSERT(!( achar0 || achar1));
22 void bool_test1(void)
25 ASSERT(!( (achar0==0) || achar1));
29 void bool_test2(void)
32 ASSERT(!( (achar0==0) || aint0));
35 void bool_and1(void)
38 ASSERT(!( achar0 && achar1));
41 void bin_or1(void)
44 char t;
46 t = achar0 | achar1;
47 ASSERT(!(t));
50 void bin_xor1(void)
53 ASSERT(!(achar0 ^ achar1));
57 void bool_test3(void)
60 ASSERT(!((achar0 == 0x42) || (achar1 == 42)));
64 void bool_or_lit1(void)
67 achar0 |= 0x0f;
69 ASSERT(!(achar0 > 0x10));
71 ASSERT(!( (achar0 | 0x10) > 0xf0));
75 void bool_and_lit1(void)
78 achar0 &= 0xf0;
80 ASSERT(!(achar0 > 0x10));
82 ASSERT(!( (achar0 & 0x10) > 0xf0));
84 achar0 &= 0xef;
88 void
89 testBool1(void)
92 bool_or1();
93 bool_or2();
94 bool_and1();
95 bin_or1();
96 bin_xor1();
98 achar0++;
99 bool_and1();
100 bool_test1();
101 bool_test2();
102 bool_test3();
105 achar0--; achar1++;
106 bool_and1();
108 achar0=0;
109 achar1=0;
111 bool_or_lit1();
112 bool_and_lit1();