Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug2944399.c
blobdff64fcc54e50e7a1f68b896b28391de7c923508
1 /*
2 bug2944399.c
3 */
5 #include <testfwk.h>
7 unsigned short Addr1(void)
9 return (0x1234);
12 unsigned short func16(unsigned short Dummy)
14 return Dummy;
17 void testBug1(void)
19 unsigned short a;
21 a = 0x0101 | Addr1();
22 ASSERT (func16(a) == (0x0101 | 0x1234));
25 void testBug2(void)
27 unsigned short a;
29 a = 0x0101 & Addr1();
30 ASSERT (func16(a) == (0x0101 & 0x1234));
33 void testBug3(void)
35 unsigned short a;
37 a = 0x0101 ^ Addr1();
38 ASSERT (func16(a) == (0x0101 ^ 0x1234));
41 void testBug4(void)
43 unsigned short a;
45 a = Addr1();
46 a |= 0x0101;
47 ASSERT (func16(a) == (0x0101 | 0x1234));