testsuite: Revert to the original version of pr100056.c
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-bitfield-write-4.c
blob66442213c9f69d534b91de7f0a7aa96d93d0b945
1 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
2 /* { dg-require-effective-target vect_int } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 extern void abort(void);
9 struct s {
10 unsigned b : 23;
11 unsigned a : 9;
14 #define N 32
15 #define V 5
16 struct s A[N];
18 void __attribute__ ((noipa))
19 f(struct s *ptr, unsigned n) {
20 for (int i = 0; i < n; ++i)
21 ptr[i].a = V;
24 void __attribute__ ((noipa))
25 check_f(struct s *ptr) {
26 #pragma GCC novector
27 for (unsigned i = 0; i < N; ++i)
28 if (ptr[i].a != V)
29 abort ();
32 int main (void)
34 check_vect ();
35 __builtin_memset (&A[0], 0, sizeof(struct s) * N);
37 f(&A[0], N);
38 check_f (&A[0]);
40 return 0;
43 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
45 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */