struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2480.c
blobd501446aa7a5a616b0ad2795519ce2f92178da2c
1 /*
2 bug-2480.c
3 */
5 #include <testfwk.h>
7 typedef unsigned char uint8_t;
9 uint8_t v[3] = {0xaa, 0xaa, 0xaa};
11 void testBug (void)
13 uint8_t aa;
14 uint8_t bb;
16 aa = v[0];
17 bb = aa & 0x80;
18 aa &= 0x7F;
19 v[1] = bb;
20 v[2] = aa;
22 ASSERT (v[0] == 0xaa);
23 ASSERT (v[1] == 0x80);
24 ASSERT (v[2] == 0x2a);