1 // { dg-require-effective-target size32plus }
3 extern "C" void abort ();
4 int r, a[1024], b[1024], q;
6 #pragma omp declare reduction (foo: int: omp_out += omp_in) initializer (omp_priv = 0)
8 __attribute__((noipa)) void
9 foo (int *a, int *b, int &r)
11 #pragma omp for reduction (inscan, foo:r)
12 for (int i = 0; i < 1024; i++)
15 #pragma omp scan inclusive(r)
20 __attribute__((noipa)) int
26 #pragma omp for reduction (inscan, foo:s)
27 for (int i = 0; i < 1024; i++)
30 #pragma omp scan inclusive(s)
36 __attribute__((noipa)) void
37 baz (int *a, int *b, int &r)
39 #pragma omp parallel for reduction (inscan, foo:r)
40 for (int i = 0; i < 1024; i++)
43 #pragma omp scan inclusive(r)
48 __attribute__((noipa)) int
53 #pragma omp parallel for reduction (inscan, foo:s)
54 for (int i = 0; i < 1024; i++)
57 #pragma omp scan inclusive(s)
67 for (int i = 0; i < 1024; ++i)
75 if (r != 1024 * 1023 / 2)
77 for (int i = 0; i < 1024; ++i)
85 if (bar () != 1024 * 1023)
88 for (int i = 0; i < 1024; ++i)
98 if (r != 1024 * 1023 / 2)
101 for (int i = 0; i < 1024; ++i)
109 if (qux () != 1024 * 1023)
112 for (int i = 0; i < 1024; ++i)