struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / not.c.in
blobf50b696d8de87964e6d52d8192b3398f84629e22
1 /** not.c test ! operator
3 ANSI: return type is int
5 attr: volatile,
6 */
7 #include <testfwk.h>
9 void
10 testNot(void)
12 signed char {attr} sc;
13 unsigned char {attr} uc;
14 unsigned int {attr} ui;
15 unsigned long {attr} ul;
17 sc = 0;
18 uc = 0;
19 ui = 0;
20 ul = 0;
21 /* remember: unsigned * signed -> unsigned */
22 /* signed * signed -> signed */
23 ASSERT(!( signed char) 0 * -1 < 0);
24 ASSERT(!(unsigned char) 0 * -1 < 0);
25 ASSERT(!sc * -1 < 0);
26 ASSERT(!uc * -1 < 0);
27 ASSERT(! 0 * -1 < 0);
28 ASSERT(! 0u * -1 < 0);
29 ASSERT(!ui * -1 < 0);
30 ASSERT(! 0l * -1 < 0);
31 ASSERT(! 0ul * -1 < 0);
32 ASSERT(!ul * -1 < 0);
34 ASSERT(!(char) 0 << 8 == 0x100);
35 ASSERT(!sc << 8 == 0x100);
36 #if !defined(PORT_HOST)
37 ASSERT(!0 << 16 == 0);
38 ASSERT(!0l << 16 == 0);
39 ASSERT(!ui << 16 == 0);
40 ASSERT(!ul << 16 == 0);
41 #endif