PR rtl-optimization/88018
[official-gcc.git] / gcc / testsuite / c-c++-common / torture / pr53505.c
blob922711025caacb27b22d3030d1d9639103b599d9
1 /* PR tree-optimization/53505 */
2 /* { dg-do run } */
4 #include <stdbool.h>
6 struct A
8 unsigned int a;
9 unsigned char c1, c2;
10 bool b1 : 1;
11 bool b2 : 1;
12 bool b3 : 1;
15 void
16 foo (const struct A *x, int y)
18 int s = 0, i;
19 for (i = 0; i < y; ++i)
21 const struct A a = x[i];
22 s += a.b1 ? 1 : 0;
24 if (s != 0)
25 __builtin_abort ();
28 int
29 main ()
31 struct A x[100];
32 int i;
33 __builtin_memset (x, -1, sizeof (x));
34 for (i = 0; i < 100; i++)
36 x[i].b1 = false;
37 x[i].b2 = false;
38 x[i].b3 = false;
40 foo (x, 100);
41 return 0;