struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-bitfld-5.c
blobb1b5c5213b1ccc00ca499a1320288e7e1149363d
1 /*
2 bitfld-5.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* See http://gcc.gnu.org/ml/gcc/2009-06/msg00072.html. */
9 #if 0 // Enable when SDCC supports bit-fields wider than 16 bits
11 struct s
13 unsigned long long a:2;
14 unsigned long long b:40;
15 unsigned long long c:22;
18 void
19 g (unsigned long long a, unsigned long long b)
21 #ifdef __SDCC
22 __asm;
23 __endasm;
24 #endif
25 if (a != b)
26 ASSERT (0);
29 void
30 f (struct s s, unsigned long long b)
32 #ifdef __SDCC
33 __asm;
34 __endasm;
35 #endif
36 g (((unsigned long long) (s.b-8)) + 8, b);
38 #endif
40 void
41 testTortureExecute (void)
43 #if 0 // Enable when SDCC supports bit-fields wider than 16 bits
44 struct s s = {1, 10, 3};
45 struct s t = {1, 2, 3};
46 f (s, 10);
47 f (t, 0x10000000002);
48 #endif
49 return;