1 extern "C" void abort ();
2 int arr[64], arr2[64], arr3[64];
5 foo (int x, int y, long z)
11 if (z != 0 || y < 0 || y >= 64)
13 #pragma omp atomic capture
21 if (y < 0 || y > 60 || (y & 3) || z < 0 || z >= 4)
24 arr2[y + z] = arr2[y + z] + 4;
27 if (z < 0 || z > 60 || (z & 3) || y < 0 || y >= 4)
30 arr2[y + z] = arr2[y + z] + 16;
33 if (y != 0 || z > 64 || z <= 0)
36 arr2[z - 1] = arr2[z - 1] + 64;
39 if ((y & 3) != 0 || y < 64 || y >= 96
40 || (z & 127) != 0 || z < 512 || z >= 1024)
42 y = (y - 64) + (z - 512) / 128;
44 arr2[y] = arr2[y] + 256;
47 if ((y & 3) != 0 || y <= 64 || y > 96
48 || (z & 127) != 1 || z <= 513 || z > 1025)
50 y = (y - 68) + (z - 641) / 128;
52 arr2[y] = arr2[y] + 1024;
59 volatile int beg, end, step, step2;
60 volatile unsigned int begu, endu;
70 for (i = 0; i < 64; i++)
71 #pragma omp task depend (iterator (j=i:i+1) , out : foo (1, j, 0)[0])
73 #pragma omp task depend (iterator (int k=beg:end:step,long int l=0:4:1) , inout : \
74 foo (2, k, l)[0], foo (3, l, k)[0]) private (i)
75 for (i = 0; i < 64; i++)
80 #pragma omp task depend (iterator (int *p=&arr3[64]:&arr3[0]:-1), inout : \
81 foo (4, 0, p - &arr3[0])[0]) depend (in : beg)
82 for (i = 0; i < 64; i++)
87 #pragma omp task depend (iterator (unsigned n=begu:endu:step2, unsigned int o = 512: 1024U: (unsigned char) 128), inout : \
88 foo (5, n + 128, o)[0])
89 for (i = 0; i < 64; i++)
94 #pragma omp task depend (iterator (int unsigned p=endu:begu:step,unsigned q= 1025U:513U:(signed char) -128), in : \
95 foo (6, p + 128, q)[0])
96 for (i = 0; i < 64; i++)
104 template <typename A, typename B, typename C, typename D, typename E, typename F>
106 baz (A beg, A end, A step, D begu, D endu, A step2)
112 for (i = 0; i < 64; i++)
113 #pragma omp task depend (iterator (A j=i:i+1),out : foo (1, j, 0)[0])
115 #pragma omp task depend (iterator (A k=beg:end:step,B l=0:4:1), inout : \
116 foo (2, k, l)[0], foo (3, l, k)[0]) private (i)
117 for (i = 0; i < 64; i++)
122 #pragma omp task depend (iterator (C p=&arr3[64]:&arr3[0]:-1), in : \
123 foo (4, 0, p - &arr3[0])[0]) depend (in : beg)
124 for (i = 0; i < 64; i++)
129 #pragma omp task depend (iterator (D n=begu:endu:step2, D o = 512: 1024U:(E) 128), inout : \
130 foo (5, n + 128, o)[0])
131 for (i = 0; i < 64; i++)
136 #pragma omp task depend (iterator (D p=endu:begu:step,D q= 1025U:513U:(F) -128), in : \
137 foo (6, p + 128, q)[0])
138 for (i = 0; i < 64; i++)
157 for (m = 0; m < 64; m++)
158 if (arr[m] != m + 15 || arr2[m] != (m < 32 ? 1365 : 85))
161 arr[m] = arr2[m] = 0;
162 baz<int, long int, int *, unsigned int, unsigned char, signed char> (beg, end, step, begu, endu, step2);
163 for (m = 0; m < 64; m++)
164 if (arr[m] != m + 15 || arr2[m] != (m < 32 ? 1365 : 85))