1  /* { dg-do compile } */
       2  /* { dg-require-effective-target vect_double } */
       3  /* { dg-additional-options "-fno-trapping-math -fno-allow-store-data-races" } */
       4  /* { dg-additional-options "-mavx" { target avx } } */
       5  
       6  #define N 1024
       7  
       8  double a[N], b[N];
       9  
      10  void foo ()
      11  {
      12    for (int i = 0; i < N; ++i)
      13      if (b[i] < 3.)
      14        a[i] += b[i];
      15  }
      16  
      17  /* We get a .MASK_STORE because while the load of a[i] does not trap
      18     the store would introduce store data races.  Make sure we still
      19     can handle the data dependence with zero distance.  */
      20  
      21  /* { dg-final { scan-tree-dump-not "versioning for alias required" "vect" { target { vect_masked_store || avx } } } } */
      22  /* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target { vect_masked_store || avx } } } } */