2 !!DESCRIPTION!! bitfield test
3 !!ORIGIN!! LCC 4.1 Testsuite
4 !!LICENCE!! own, freely distributeable for non-profit. read CPYRIGHT.LCC
11 printf("NO_BITFIELDS\n\r");
16 #ifdef SIZEOF_INT_16BIT
23 int16_t x : 12, y : 4;
24 int16_t zz : 1, : 0, : 4, z : 3;
26 } x = { 1, 2, 3, 4, 5, 6 };
28 struct baz { uint16_t a:2, b:4, c:16;} y = { 7, 8, 9};
37 int zz : 1, : 0, : 4, z : 3;
39 } x = { 1, 2, 3, 4, 5, 6 };
41 struct baz { unsigned int a:2, b:4, c:16;} y = { 7, 8, 9};
49 int x : 12, y : 4, : 0, : 4, z : 3;
51 } x = { 1, 2, 3, 4, 5, 6 };
53 struct baz { unsigned int a:2, b:4, c:32;} y = { 7, 8, 9};
57 #ifdef NO_IMPLICIT_FUNC_PROTOTYPES
64 printf("x = %d b:%d %d %d %d c:%d\n", x.a, x.b, x.x, x.y, x.z, x.c);
65 printf("y = %d b:%d c:%d\n", y.a, y.b, y.c);
68 printf("x = %d b:%d %d %d %d c:%d\n", x.a, x.b, x.x, x.y, x.z, x.c);
71 printf("y = %d b:%d c:%d\n", y.a, y.b, y.c);
72 #ifdef CAST_STRUCT_PTR
83 printf("p->b != 0!\n");
84 p->a = 0x3; p->b = 0xf;
85 printf("p->a = 0x%x, p->b = 0x%x\n", p->a, p->b);