Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-bitfield-write-3.c
blobe96da82c214a03c4b14379be27a52eec6b3ef243
1 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
2 /* { dg-require-effective-target vect_int } */
3 /* { dg-require-effective-target vect_long_long } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 extern void abort(void);
10 struct s {
11 unsigned i : 31;
12 char x : 2;
13 char a : 4;
16 #define N 32
17 #define V 5
18 struct s A[N];
20 void __attribute__ ((noipa))
21 f(struct s *ptr, unsigned n) {
22 for (int i = 0; i < n; ++i)
23 ptr[i].a = V;
26 void __attribute__ ((noipa))
27 check_f(struct s *ptr) {
28 #pragma GCC novector
29 for (unsigned i = 0; i < N; ++i)
30 if (ptr[i].a != V)
31 abort ();
34 int main (void)
36 check_vect ();
37 __builtin_memset (&A[0], 0, sizeof(struct s) * N);
39 f(&A[0], N);
40 check_f (&A[0]);
42 return 0;
45 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
47 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */