* config/msp430/msp430.md (zero_extendhipsi2): Use MOVX.A to store
[official-gcc.git] / libgomp / testsuite / libgomp.c++ / pr66702-1.C
blob15772561b1a1f0914f7865ad421cc59fc1cb4773
1 // PR middle-end/66702
2 // { dg-options "-O2" }
3 // { dg-additional-options "-msse2" { target sse2_runtime } }
4 // { dg-additional-options "-mavx" { target avx_runtime } }
6 void
7 bar (int &a, int &b, int *&c, int &d)
9   volatile int x;
10   int *volatile y;
11   x = a; a = x;
12   x = b; b = x;
13   y = c; c = y;
14   x = d; d = x;
17 void (*volatile barp) (int &, int &, int *&, int &) = bar;
19 #pragma omp declare simd uniform(b, c) linear(d:2) aligned(c:32) notinbranch
20 int
21 foo (int a, int b, int *c, int d)
23   a++;
24   b++;
25   c += 8;
26   d += 2;
27   barp (a, b, c, d);
28   return a + b + *c + d;
31 volatile int e = 5;
32 int c[64] __attribute__((aligned (32)));
34 int
35 main ()
37   int d = 7, r = 0;
38   int b = e;
39   for (int i = 0; i < 64; i++)
40     c[i] = i;
41   #pragma omp simd reduction(+:r) linear(d:2)
42   for (int i = 0; i < 64; i++)
43     {
44       r += foo (i, b, c, d);
45       d += 2;
46     }
47   if (r != 7584)
48     __builtin_abort ();