1 /*
2    bug-2539.c
3 */
4 
5 #include <testfwk.h>
6 
7 #include <stdint.h>
8 
9 struct sBITS {
10   unsigned  b0 : 1;
11   unsigned  b1 : 1;
12   unsigned  b2 : 1;
13   unsigned  b3 : 1;
14   unsigned  b4 : 1;
15   unsigned  b5 : 1;
16   unsigned  b6 : 1;
17   unsigned  b7 : 1;
18 };
19 struct sBITS vb;
20 
SetIf(uint8_t x)21 void SetIf(uint8_t x)
22 {
23   vb.b3 = (x != 0); // only bit 0 of 'x' testet
24 }
25 
testBug(void)26 void testBug(void)
27 {
28   SetIf(0);
29 
30   ASSERT(!vb.b3);
31 
32   SetIf(24);
33 
34   ASSERT(vb.b3);
35 }
36 
37