testsuite: Revert to the original version of pr100056.c
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-pr111779.c
blob2400de10590221f94fc36471a2cbb543bb5d8276
1 #include <stdbool.h>
2 #include "tree-vect.h"
4 struct C
6 int c;
7 int d;
8 bool f :1;
9 float e;
12 struct A
14 unsigned int a;
15 unsigned char c1, c2;
16 bool b1 : 1;
17 bool b2 : 1;
18 bool b3 : 1;
19 struct C b4;
22 void __attribute__((noipa))
23 foo (const struct A * __restrict x, int y)
25 int s = 0, i = 0;
26 for (i = 0; i < y; ++i)
28 const struct A a = x[i];
29 s += a.b4.f ? 1 : 0;
31 if (s != 0)
32 __builtin_abort ();
35 int
36 main ()
38 struct A x[100];
39 int i;
41 check_vect ();
43 __builtin_memset (x, -1, sizeof (x));
44 #pragma GCC novect
45 for (i = 0; i < 100; i++)
47 x[i].b1 = false;
48 x[i].b2 = false;
49 x[i].b3 = false;
50 x[i].b4.f = false;
52 foo (x, 100);
53 return 0;
56 /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_int && { le || { be && vect_shift_char } } } } } } */