cfgexpand: Expand comment on when non-var clobbers can show up
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-bitfield-read-1-not.c
blob85f4de8464a5e7e774ad7f33603a1519e5fe4f16
1 /* { dg-require-effective-target vect_shift } */
2 /* { dg-require-effective-target vect_long_long } */
3 /* { dg-additional-options { "-fdump-tree-ifcvt-all" } } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 extern void abort(void);
10 struct s {
11 char a : 4;
14 #define N 32
15 #define ELT0 {0}
16 #define ELT1 {1}
17 #define ELT2 {2}
18 #define ELT3 {3}
19 #define RES 56
20 struct s A[N]
21 = { ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3,
22 ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3,
23 ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3,
24 ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3};
26 int __attribute__ ((noipa))
27 f(struct s *ptr, unsigned n) {
28 int res = 0;
29 for (int i = 0; i < n; ++i)
31 switch (ptr[i].a)
33 case 0:
34 res += ptr[i].a + 1;
35 break;
36 case 1:
37 case 2:
38 case 3:
39 res += ptr[i].a;
40 break;
41 default:
42 return 0;
45 return res;
48 int main (void)
50 check_vect ();
52 if (f(&A[0], N) != RES)
53 abort ();
55 return 0;
58 /* { dg-final { scan-tree-dump-times "Bitfield OK to lower." 0 "ifcvt" { xfail *-*-* } } } */