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