1/* { dg-do compile } */
2/* { dg-require-effective-target avx2 } */
3/* { dg-options "-mavx2 -O3 -fopenmp-simd -fdump-tree-vect-details" } */
4
5#define N 256
6int a1[N], a2[N], a3[N], a4[N], a5[N], a6[N], a7[N];
7
8void foo()
9{
10  int x1, x2, x3;
11  int i;
12#pragma omp simd safelen(8)
13  for (i=0; i<N; i++)
14    {
15      x1 = a1[i] + a2 [i];
16	if (x1 >= 0 && x1 != 3)
17	  {
18	    x2 = a3[i] - a1[i];
19	    if (x2 >= 0 && x2 != 4)
20	      {
21		x3 = a4[i] + a5[i];
22		if (x3 >= 0 && x3 != 5)
23		  {
24		    a6[i] = x1 - x2;
25		    a7[i] = x3 + x2;
26		  }
27	      }
28	  }
29    }
30}
31
32/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
33/* { dg-final { cleanup-tree-dump "vect" } } */
34