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