(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
pr57741-3.c
       1  /* PR tree-optimization/57741 */
       2  /* { dg-require-effective-target vect_float } */
       3  /* { dg-require-effective-target vect_int } */
       4  /* { dg-additional-options "-ffast-math" } */
       5  
       6  #include "tree-vect.h"
       7  
       8  extern void abort (void);
       9  
      10  float p[1024] __attribute__((aligned (32))) = { 17.0f };
      11  float q[1024] __attribute__((aligned (32))) = { 17.0f };
      12  char r[1024] __attribute__((aligned (32))) = { 1 };
      13  
      14  __attribute__((noinline, noclone)) void
      15  foo (float x)
      16  {
      17    int i;
      18    float f = 1.0f, g = 2.0f;
      19    for (i = 0; i < 1024; i++)
      20      {
      21        p[i] = f;
      22        f += x;
      23        q[i] = g;
      24        g += 0.5f;
      25        r[i]++;
      26      }
      27  }
      28  
      29  int
      30  main ()
      31  {
      32    int i;
      33    check_vect ();
      34    r[0] = 0;
      35    foo (1.5f);
      36    for (i = 0; i < 1024; i++)
      37      if (p[i] != 1.0f + i * 1.5f || q[i] != 2.0f + i * 0.5f || r[i] != 1)
      38        abort ();
      39    return 0;
      40  }
      41  
      42  /* { dg-final { scan-tree-dump-times "vectorized 1 loop" 1 "vect" } } */