(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr103144-neg-1.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -mavx2 -ftree-vectorize -fvect-cost-model=unlimited -fdump-tree-vect-details -mprefer-vector-width=256" } */
       3  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" } } */
       4  
       5  #define N 10000
       6  
       7  void
       8  __attribute__((noipa))
       9  foo_neg (int* a, int b)
      10  {
      11    for (int i = 0; i != N; i++)
      12      {
      13        a[i] = b;
      14        b = -b;
      15      }
      16  }
      17  
      18  void
      19  __attribute__((noipa))
      20  foo_neg_const (int* a)
      21  {
      22    int b = 1;
      23    for (int i = 0; i != N; i++)
      24      {
      25        a[i] = b;
      26        b = -b;
      27      }
      28  }
      29  
      30  void
      31  __attribute__((noipa))
      32  foo_neg_peel (int* a, int b, int n)
      33  {
      34    for (int i = 0; i != n; i++)
      35      {
      36        a[i] = b;
      37        b = -b;
      38      }
      39  }
      40  
      41  void
      42  __attribute__((noipa))
      43  foo_neg_const_peel (int* a, int n)
      44  {
      45    int b = 1;
      46    for (int i = 0; i != n; i++)
      47      {
      48        a[i] = b;
      49        b = -b;
      50      }
      51  }