1 /* { dg-do compile } */
2 /* { dg-options "-O2 -w" } */
3 typedef unsigned int hashval_t;
4 enum ETYPE
5 {
6   ETYPE_ARRAY, ETYPE_STRUCT, ETYPE_UNION,
7 };
8 struct entry
9 {
10   enum ETYPE etype:8;
11   unsigned short len;
12   const char *attrib;
13 };
e_hash(const void * a)14 e_hash (const void *a)
15 {
16   const struct entry *e = a;
17   hashval_t ret = 0;
18   int i;
19   if (e[0].etype != ETYPE_STRUCT && e[0].etype != ETYPE_UNION)
20     abort ();
21   for (i = 0; i <= e[0].len; ++i)
22     {
23       ret = iterative_hash (&e[i], __builtin_offsetof (struct entry, attrib), ret);
24     }
25   return ret;
26 }
27