2 !!DESCRIPTION!! bitfield test
3 !!ORIGIN!! LCC 4.1 Testsuite
4 !!LICENCE!! own, freely distributeable for non-profit. read CPYRIGHT.LCC
13 printf("NO_BITFIELDS\n\r");
18 #ifdef SIZEOF_INT_16BIT
25 int16_t x : 12, y : 4;
26 int16_t zz : 1, : 0, : 4, z : 3;
28 } x = { 1, 2, 3, 4, 5, 6 };
30 struct baz { uint16_t a:2, b:4, c:16;} y = { 7, 8, 9};
39 int zz : 1, : 0, : 4, z : 3;
41 } x = { 1, 2, 3, 4, 5, 6 };
43 struct baz { unsigned int a:2, b:4, c:16;} y = { 7, 8, 9};
51 int x : 12, y : 4, : 0, : 4, z : 3;
53 } x = { 1, 2, 3, 4, 5, 6 };
55 struct baz { unsigned int a:2, b:4, c:32;} y = { 7, 8, 9};
59 #ifdef NO_IMPLICIT_FUNC_PROTOTYPES
66 printf("x = %d b:%d %d %d %d c:%d\n", x.a, x.b, x.x, x.y, x.z, x.c);
67 printf("y = %d b:%d c:%d\n", y.a, y.b, y.c);
70 printf("x = %d b:%d %d %d %d c:%d\n", x.a, x.b, x.x, x.y, x.z, x.c);
73 printf("y = %d b:%d c:%d\n", y.a, y.b, y.c);
74 #ifdef CAST_STRUCT_PTR
85 printf("p->b != 0!\n");
86 p->a = 0x3; p->b = 0xf;
87 printf("p->a = 0x%x, p->b = 0x%x\n", p->a, p->b);