(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
vect-bitfield-write-2.c
       1  /* { dg-require-effective-target vect_int } */
       2  /* { dg-require-effective-target vect_long_long } */
       3  
       4  #include <stdarg.h>
       5  #include "tree-vect.h"
       6  
       7  extern void abort(void);
       8  
       9  struct s {
      10      unsigned i : 31;
      11      char a : 4;
      12  };
      13  
      14  #define N 32
      15  #define V 5
      16  struct s A[N];
      17  
      18  void __attribute__ ((noipa))
      19  f(struct s *ptr, unsigned n) {
      20      for (int i = 0; i < n; ++i)
      21        ptr[i].a = V;
      22  }
      23  
      24  void __attribute__ ((noipa))
      25  check_f(struct s *ptr) {
      26      for (unsigned i = 0; i < N; ++i)
      27        if (ptr[i].a != V)
      28  	abort ();
      29  }
      30  
      31  int main (void)
      32  {
      33    check_vect ();
      34    __builtin_memset (&A[0], 0, sizeof(struct s) * N);
      35  
      36    f(&A[0], N);
      37    check_f (&A[0]);
      38  
      39    return 0;
      40  }
      41  
      42  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
      43