1 /* PR tree-optimization/80631 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -ftree-vectorize -mavx2 -fno-vect-cost-model" } */
4 /* { dg-require-effective-target avx2 } */
5 
6 #include "avx2-check.h"
7 
8 #define N 8
9 
10 static void
avx2_test(void)11 avx2_test (void)
12 {
13   int v[N], k;
14   for(k = 0; k < N; k++)
15     v[k] = k;
16   v[0] = 77;
17   int found_index = -1;
18   for (k = 0; k < N; k++)
19     if (v[k] == 77)
20       found_index = k;
21   if (found_index != 0)
22     abort ();
23 }
24