1 /*
2    pr38411.c from the execute part of the gcc torture tests.
3  */
4 
5 #include <testfwk.h>
6 
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
10 
11 #ifndef __SDCC_pic16 // TODO: enable when the pic16 ports supports bitfields of size greater than 8 bits!
12 #include <limits.h>
13 
14 /* PR middle-end/38422 */
15 
16 struct S
17 {
18   int s : (sizeof (int) * CHAR_BIT - 2);
19 } s;
20 
21 void
foo(void)22 foo (void)
23 {
24   s.s *= 2;
25 }
26 #endif
27 
28 void
testTortureExecute(void)29 testTortureExecute (void)
30 {
31 #ifndef __SDCC_pic16
32   s.s = 24;
33   foo ();
34   if (s.s != 48)
35     ASSERT (0);
36   return;
37 #endif
38 }
39