struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-bf64-1.c
blobae836bdfd6e356eac2f240e2c174657759e43669
1 /*
2 bf64-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #if 0 // Enable when SDCC supports bit-fields wider than 16 bits
8 /* { dg-xfail-if "ABI specifies bitfields cannot exceed 32 bits" { mcore-*-* } } */
9 struct tmp
11 long long int pad : 12;
12 long long int field : 52;
15 struct tmp2
17 long long int field : 52;
18 long long int pad : 12;
21 struct tmp
22 sub (struct tmp tmp)
24 tmp.field |= 0x0008765412345678LL;
25 return tmp;
28 struct tmp2
29 sub2 (struct tmp2 tmp2)
31 tmp2.field |= 0x0008765412345678LL;
32 return tmp2;
34 #endif
36 void
37 testTortureExecute (void)
39 #if 0 // Enable when SDCC supports bit-fields wider than 16 bits
40 struct tmp tmp = {0x123, 0xFFF000FFF000FLL};
41 struct tmp2 tmp2 = {0xFFF000FFF000FLL, 0x123};
43 tmp = sub (tmp);
44 tmp2 = sub2 (tmp2);
46 if (tmp.pad != 0x123 || tmp.field != 0xFFFFFF541FFF567FLL)
47 ASSERT (0);
48 if (tmp2.pad != 0x123 || tmp2.field != 0xFFFFFF541FFF567FLL)
49 ASSERT (0);
50 return;
51 #endif