OSDN Git Service

PR middle-end/35314
[pf3gnuchains/gcc-fork.git] / libmudflap / testsuite / libmudflap.c / pass23-frag.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 int main ()
5 {
6 struct foo {
7   int part1: 8;
8   int nothing : 1;
9   int part2 : 5;
10   int lots_more_nothing : 3;
11   int some_padding; /* for 64-bit hosts */
12   float some_more_nothing;
13   double yet_more_nothing;
14 };
15
16 #define offsetof(TYPE, MEMBER)  ((size_t) &((TYPE *) 0)->MEMBER)
17
18 struct foo* q = (struct foo *) malloc (offsetof (struct foo, some_more_nothing));
19 q->nothing = 1; /* touch q */ 
20 /* The RHS of the following expression is meant to trigger a
21    fold-const.c mapping the expression to a BIT_FIELD_REF.  It glues
22    together the accesses to the two non-neighbouring bitfields into a
23    single bigger boolean test. */
24 q->lots_more_nothing = (q->part1 == 13 && q->part2 == 7);
25 free (q);
26
27
28 return 0;
29 }