libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr68619-3.c
blob7209615f322c37af45493a8ddabf3592afd5b5df
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -w" } */
3 typedef unsigned int hashval_t;
4 enum ETYPE
6 ETYPE_ARRAY, ETYPE_STRUCT, ETYPE_UNION,
7 };
8 struct entry
10 enum ETYPE etype:8;
11 unsigned short len;
12 const char *attrib;
14 hashval_t iterative_hash (const struct entry *, __SIZE_TYPE__, hashval_t);
15 hashval_t
16 e_hash (const void *a)
18 const struct entry *e = a;
19 hashval_t ret = 0;
20 int i;
21 if (e[0].etype != ETYPE_STRUCT && e[0].etype != ETYPE_UNION)
22 __builtin_abort ();
23 for (i = 0; i <= e[0].len; ++i)
25 ret = iterative_hash (&e[i], __builtin_offsetof (struct entry, attrib), ret);
27 return ret;