Fix compilation failure with C++98 compilers
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / loop-13.c
blob997c628fae62fa54fbe980b26053c12b8162899a
1 /* { dg-do run } */
3 volatile int ji = 100, ki = 2;
4 volatile unsigned int ju = 100, ku = 2;
5 volatile long long int jll = 100, kll = 2;
6 volatile unsigned long long int jull = 100, kull = 2;
7 unsigned long long l;
9 void
10 f0 (void)
12 int i, j, k;
13 unsigned int j2, k2;
14 #pragma omp for reduction(+: l)
15 for (i = ji; i < ki; i++)
16 l++;
17 if (l != 0)
18 __builtin_abort ();
19 #pragma omp parallel for reduction(+: l)
20 for (i = ji; i < ki; i++)
21 l++;
22 if (l != 0)
23 __builtin_abort ();
24 #pragma omp for reduction(+: l) collapse(3)
25 for (j = 0; j < 4; j++)
26 for (i = ji; i < ki; i++)
27 for (k = 0; k < 5; k += 2)
28 l++;
29 if (l != 0)
30 __builtin_abort ();
31 #pragma omp parallel for reduction(+: l) collapse(3)
32 for (j = 0; j < 4; j++)
33 for (i = ji; i < ki; i++)
34 for (k = 0; k < 5; k += 2)
35 l++;
36 if (l != 0)
37 __builtin_abort ();
38 #pragma omp for reduction(+: l) collapse(3)
39 for (j2 = 0; j2 < 4; j2++)
40 for (i = ji; i < ki; i++)
41 for (k2 = 0; k2 < 5; k2 += 2)
42 l++;
43 if (l != 0)
44 __builtin_abort ();
45 #pragma omp parallel for reduction(+: l) collapse(3)
46 for (j2 = 0; j2 < 4; j2++)
47 for (i = ji; i < ki; i++)
48 for (k2 = 0; k2 < 5; k2 += 2)
49 l++;
50 if (l != 0)
51 __builtin_abort ();
52 #pragma omp parallel for reduction(+: l) collapse(3)
53 for (j = 0; j < 4; j++)
54 for (i = ji; i < ki; i++)
55 for (k = ki + 10; k < ji - 10; k += 2)
56 l++;
57 if (l != 0)
58 __builtin_abort ();
59 #pragma omp parallel for reduction(+: l) collapse(3)
60 for (j = ki + 10; j < ji - 10; j++)
61 for (i = ji; i < ki; i++)
62 for (k = 0; k < 5; k += 2)
63 l++;
64 if (l != 0)
65 __builtin_abort ();
68 void
69 f1 (void)
71 unsigned int i, j, k;
72 int j2, k2;
73 #pragma omp for reduction(+: l)
74 for (i = ju; i < ku; i++)
75 l++;
76 if (l != 0)
77 __builtin_abort ();
78 #pragma omp parallel for reduction(+: l)
79 for (i = ju; i < ku; i++)
80 l++;
81 if (l != 0)
82 __builtin_abort ();
83 #pragma omp for reduction(+: l) collapse(3)
84 for (j = 0; j < 4; j++)
85 for (i = ju; i < ku; i++)
86 for (k = 0; k < 5; k += 2)
87 l++;
88 if (l != 0)
89 __builtin_abort ();
90 #pragma omp parallel for reduction(+: l) collapse(3)
91 for (j = 0; j < 4; j++)
92 for (i = ju; i < ku; i++)
93 for (k = 0; k < 5; k += 2)
94 l++;
95 if (l != 0)
96 __builtin_abort ();
97 #pragma omp for reduction(+: l) collapse(3)
98 for (j2 = 0; j2 < 4; j2++)
99 for (i = ju; i < ku; i++)
100 for (k2 = 0; k2 < 5; k2 += 2)
101 l++;
102 if (l != 0)
103 __builtin_abort ();
104 #pragma omp parallel for reduction(+: l) collapse(3)
105 for (j2 = 0; j2 < 4; j2++)
106 for (i = ju; i < ku; i++)
107 for (k2 = 0; k2 < 5; k2 += 2)
108 l++;
109 if (l != 0)
110 __builtin_abort ();
111 #pragma omp parallel for reduction(+: l) collapse(3)
112 for (j = 0; j < 4; j++)
113 for (i = ju; i < ku; i++)
114 for (k = ku; k < ju; k += 2)
115 l++;
116 if (l != 0)
117 __builtin_abort ();
118 #pragma omp parallel for reduction(+: l) collapse(3)
119 for (j = ku; j < ju; j++)
120 for (i = ju; i < ku; i++)
121 for (k = 0; k < 5; k += 2)
122 l++;
123 if (l != 0)
124 __builtin_abort ();
127 void
128 f2 (void)
130 long long int i, j, k;
131 unsigned long long int j2, k2;
132 #pragma omp for reduction(+: l)
133 for (i = jll; i < kll; i++)
134 l++;
135 if (l != 0)
136 __builtin_abort ();
137 #pragma omp parallel for reduction(+: l)
138 for (i = jll; i < kll; i++)
139 l++;
140 if (l != 0)
141 __builtin_abort ();
142 #pragma omp for reduction(+: l) collapse(3)
143 for (j = 0; j < 4; j++)
144 for (i = jll; i < kll; i++)
145 for (k = 0; k < 5; k += 2)
146 l++;
147 if (l != 0)
148 __builtin_abort ();
149 #pragma omp parallel for reduction(+: l) collapse(3)
150 for (j = 0; j < 4; j++)
151 for (i = jll; i < kll; i++)
152 for (k = 0; k < 5; k += 2)
153 l++;
154 if (l != 0)
155 __builtin_abort ();
156 #pragma omp for reduction(+: l) collapse(3)
157 for (j2 = 0; j2 < 4; j2++)
158 for (i = jll; i < kll; i++)
159 for (k2 = 0; k2 < 5; k2 += 2)
160 l++;
161 if (l != 0)
162 __builtin_abort ();
163 #pragma omp parallel for reduction(+: l) collapse(3)
164 for (j2 = 0; j2 < 4; j2++)
165 for (i = jll; i < kll; i++)
166 for (k2 = 0; k2 < 5; k2 += 2)
167 l++;
168 if (l != 0)
169 __builtin_abort ();
170 #pragma omp parallel for reduction(+: l) collapse(3)
171 for (j = 0; j < 4; j++)
172 for (i = jll; i < kll; i++)
173 for (k = kll; k < jll; k += 2)
174 l++;
175 if (l != 0)
176 __builtin_abort ();
177 #pragma omp parallel for reduction(+: l) collapse(3)
178 for (j = kll; j < jll; j++)
179 for (i = jll; i < kll; i++)
180 for (k = 0; k < 5; k += 2)
181 l++;
182 if (l != 0)
183 __builtin_abort ();
186 void
187 f3 (void)
189 unsigned long long int i, j, k;
190 long long int j2, k2;
191 #pragma omp for reduction(+: l)
192 for (i = jull; i < kull; i++)
193 l++;
194 if (l != 0)
195 __builtin_abort ();
196 #pragma omp parallel for reduction(+: l)
197 for (i = jull; i < kull; i++)
198 l++;
199 if (l != 0)
200 __builtin_abort ();
201 #pragma omp for reduction(+: l) collapse(3)
202 for (j = 0; j < 4; j++)
203 for (i = jull; i < kull; i++)
204 for (k = 0; k < 5; k += 2)
205 l++;
206 if (l != 0)
207 __builtin_abort ();
208 #pragma omp parallel for reduction(+: l) collapse(3)
209 for (j = 0; j < 4; j++)
210 for (i = jull; i < kull; i++)
211 for (k = 0; k < 5; k += 2)
212 l++;
213 if (l != 0)
214 __builtin_abort ();
215 #pragma omp for reduction(+: l) collapse(3)
216 for (j2 = 0; j2 < 4; j2++)
217 for (i = jull; i < kull; i++)
218 for (k2 = 0; k2 < 5; k2 += 2)
219 l++;
220 if (l != 0)
221 __builtin_abort ();
222 #pragma omp parallel for reduction(+: l) collapse(3)
223 for (j2 = 0; j2 < 4; j2++)
224 for (i = jull; i < kull; i++)
225 for (k2 = 0; k2 < 5; k2 += 2)
226 l++;
227 if (l != 0)
228 __builtin_abort ();
229 #pragma omp parallel for reduction(+: l) collapse(3)
230 for (j = 0; j < 4; j++)
231 for (i = jull; i < kull; i++)
232 for (k = kull; k < jull; k += 2)
233 l++;
234 if (l != 0)
235 __builtin_abort ();
236 #pragma omp parallel for reduction(+: l) collapse(3)
237 for (j = kull; j < jull; j++)
238 for (i = jull; i < kull; i++)
239 for (k = 0; k < 5; k += 2)
240 l++;
241 if (l != 0)
242 __builtin_abort ();
246 main ()
248 f0 ();
249 f1 ();
250 f2 ();
251 f3 ();
252 return 0;