i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-bitfield-read-8.c
blob52cfd33d937ae90f3fe9556716c90e098b768ac8
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_shift } */
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 { int i : 31; };
12 #define ELT0 {0}
13 #define ELT1 {1}
14 #define ELT2 {2}
15 #define ELT3 {3}
16 #define ELT4 {4}
17 #define N 32
18 #define RES 25
19 struct s A[N]
20 = { ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3,
21 ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3,
22 ELT0, ELT1, ELT4, ELT3, ELT0, ELT1, ELT2, ELT3,
23 ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3};
25 int __attribute__ ((noipa))
26 f(struct s *ptr, unsigned n) {
27 int res = 0;
28 for (int i = 0; i < n; ++i)
30 if (ptr[i].i == 4)
31 return res;
32 res += ptr[i].i;
35 return res;
38 int main (void)
40 check_vect ();
42 if (f(&A[0], N) != RES)
43 abort ();
45 return 0;
48 /* { dg-final { scan-tree-dump "Bitfield OK to lower." "ifcvt" } } */