3 __attribute__((noinline, noclone)) void
4 foo (int (*&x)[3][2], int *y, long (&w)[1][2])
6 unsigned long long a[9] = {};
8 #pragma omp parallel for reduction(+:x[0:2][:][0:2], z[:4]) \
9 reduction(*:y[:3]) reduction(|:a[:4]) \
10 reduction(&:w[0:][:2]) reduction(max:b)
11 for (int i = 0; i < 128; i++)
13 x[i / 64][i % 3][(i / 4) & 1] += i;
23 a[i / 32] |= 1ULL << (i & 30);
24 w[0][i & 1] &= ~(1L << (i / 17 * 3));
36 for (int i = 0; i < 9; i++)
37 if (a[i] != (i < 4 ? 0x55555555ULL : 0))
39 if (b[0] != 78 || b[1] != 12 || b[2] != 22 || b[3] != 84 || b[4] != 127)
44 int (*p3)[3][2] = &a3[1];
45 int y3[5] = { 0, 1, 1, 1, 0 };
46 long w3[1][2] = { ~0L, ~0L };
56 unsigned long long a[9];
57 S() : x(p3), y(y3+1), w(w3), z(), a(), b(bb) {}
58 __attribute__((noinline, noclone)) void foo ();
64 #pragma omp parallel for reduction(+:x[0:2][:][0:2], z[:4]) \
65 reduction(*:y[:3]) reduction(|:a[:4]) \
66 reduction(&:w[0:][:2]) reduction(max:b)
67 for (int i = 0; i < 128; i++)
69 x[i / 64][i % 3][(i / 4) & 1] += i;
79 a[i / 32] |= 1ULL << (i & 30);
80 w[0][i & 1] &= ~(1L << (i / 17 * 3));
98 static int a2[4][3][2] = {{{ 0, 0 }, { 0, 0 }, { 0, 0 }},
99 {{ 312, 381 }, { 295, 356 }, { 337, 335 }},
100 {{ 1041, 975 }, { 1016, 1085 }, { 935, 1060 }},
101 {{ 0, 0 }, { 0, 0 }, { 0, 0 }}};
102 int (*p)[3][2] = &a[1];
103 int y[5] = { 0, 1, 1, 1, 0 };
104 int y2[5] = { 0, 6561, 2401, 289, 0 };
105 char z2[10] = { 48, 49, 50, 51, 0, 0, 0, 0, 0, 0 };
106 long w[1][2] = { ~0L, ~0L };
108 if (__builtin_memcmp (a, a2, sizeof (a))
109 || __builtin_memcmp (y, y2, sizeof (y))
110 || __builtin_memcmp (z, z2, sizeof (z))
111 || w[0][0] != ~0x249249L
112 || w[0][1] != ~0x249249L)
116 for (int i = 0; i < 9; i++)
117 if (s.a[i] != (i < 4 ? 0x55555555ULL : 0))
119 if (__builtin_memcmp (a3, a2, sizeof (a3))
120 || __builtin_memcmp (y3, y2, sizeof (y3))
121 || __builtin_memcmp (s.z, z2, sizeof (s.z))
122 || w3[0][0] != ~0x249249L
123 || w3[0][1] != ~0x249249L)
125 if (bb[0] != 78 || bb[1] != 12 || bb[2] != 22 || bb[3] != 84 || bb[4] != 127)