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