3 __attribute__((noinline, noclone)) void
4 foo (int (*&x)[3][2], int *y, long (&w)[1][2], int p1, long p2, long p3, int p4,
5 int p5, long p6, short p7)
7 unsigned long long a[p7 + 4];
9 for (int i = 0; i < p7 + 4; i++)
15 #pragma omp parallel for reduction(+:x[0:p1 + 1][:p2], z[:p3]) \
16 reduction(*:y[:p4]) reduction(|:a[:p5]) \
17 reduction(&:w[0:p6 - 1][:p6]) reduction(max:b)
18 for (int i = 0; i < 128; i++)
20 x[i / 64][i % 3][(i / 4) & 1] += i;
30 a[i / 32] |= 1ULL << (i & 30);
31 w[0][i & 1] &= ~(1L << (i / 17 * 3));
43 for (int i = 0; i < 9; i++)
44 if (a[i] != (i < 4 ? 0x55555555ULL : 0))
46 if (b[0] != 78 || b[1] != 12 || b[2] != 22 || b[3] != 84 || b[4] != 127)
51 int (*p3)[3][2] = &a3[1];
52 int y3[5] = { 0, 1, 1, 1, 0 };
53 long w3[1][2] = { ~0L, ~0L };
63 unsigned long long a[9];
64 S() : x(p3), y(y3+1), w(w3), z(), a(), b(bb) {}
65 __attribute__((noinline, noclone)) void foo (int, long, long, int, int, long, short);
69 S::foo (int p1, long p2, long p3, int p4, int p5, long p6, short p7)
71 #pragma omp parallel for reduction(+:x[0:p1 + 1][:p2], z[:p3]) \
72 reduction(*:y[:p4]) reduction(|:a[:p5]) \
73 reduction(&:w[0:p6 - 1][:p6]) reduction(max:b[0:p7])
74 for (int i = 0; i < 128; i++)
76 x[i / 64][i % 3][(i / 4) & 1] += i;
86 a[i / 32] |= 1ULL << (i & 30);
87 w[0][i & 1] &= ~(1L << (i / 17 * 3));
105 static int a2[4][3][2] = {{{ 0, 0 }, { 0, 0 }, { 0, 0 }},
106 {{ 312, 381 }, { 295, 356 }, { 337, 335 }},
107 {{ 1041, 975 }, { 1016, 1085 }, { 935, 1060 }},
108 {{ 0, 0 }, { 0, 0 }, { 0, 0 }}};
109 int (*p)[3][2] = &a[1];
110 int y[5] = { 0, 1, 1, 1, 0 };
111 int y2[5] = { 0, 6561, 2401, 289, 0 };
112 char z2[10] = { 48, 49, 50, 51, 0, 0, 0, 0, 0, 0 };
113 long w[1][2] = { ~0L, ~0L };
114 foo (p, y + 1, w, 1, 3L, 4L, 3, 4, 2L, 5);
115 if (__builtin_memcmp (a, a2, sizeof (a))
116 || __builtin_memcmp (y, y2, sizeof (y))
117 || __builtin_memcmp (z, z2, sizeof (z))
118 || w[0][0] != ~0x249249L
119 || w[0][1] != ~0x249249L)
122 s.foo (1, 3L, 4L, 3, 4, 2L, 5);
123 for (int i = 0; i < 9; i++)
124 if (s.a[i] != (i < 4 ? 0x55555555ULL : 0))
126 if (__builtin_memcmp (a3, a2, sizeof (a3))
127 || __builtin_memcmp (y3, y2, sizeof (y3))
128 || __builtin_memcmp (s.z, z2, sizeof (s.z))
129 || w3[0][0] != ~0x249249L
130 || w3[0][1] != ~0x249249L)
132 if (bb[0] != 78 || bb[1] != 12 || bb[2] != 22 || bb[3] != 84 || bb[4] != 127)