libsanitizer: On aarch64 use hint #34 in prologue of libsanitizer functions
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / if-1.f90
blob5ba6509749e4507c99591de59237038eb8bb180c
1 ! OpenACC 'if' clause.
3 ! See also 'self-1.f90'.
5 ! { dg-do run }
6 ! { dg-additional-options "-cpp" }
8 ! { dg-additional-options "--param=openacc-kernels=decompose" }
10 ! { dg-additional-options "-fopt-info-note-omp" }
11 ! { dg-additional-options "-foffload=-fopt-info-note-omp" }
13 ! { dg-additional-options "--param=openacc-privatization=noisy" }
14 ! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
15 ! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types):
16 ! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} }
18 ! It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
19 ! passed to 'incr' may be unset, and in that case, it will be set to [...]",
20 ! so to maintain compatibility with earlier Tcl releases, we manually
21 ! initialize counter variables:
22 ! { dg-line l_dummy[variable c_compute 0] }
23 ! { dg-message "dummy" "" { target iN-VAl-Id } l_dummy } to avoid
24 ! "WARNING: dg-line var l_dummy defined, but not used". */
26 program main
27 use openacc
28 implicit none
30 integer, parameter :: N = 8
31 integer, parameter :: one = 1
32 integer, parameter :: zero = 0
33 integer i, nn
34 real, allocatable :: a(:), b(:)
35 real exp, exp2
37 i = 0
39 allocate (a(N))
40 allocate (b(N))
42 a(:) = 4.0
44 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (1 == 1) ! { dg-line l_compute[incr c_compute] }
45 do i = 1, N
46 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
47 !TODO Unhandled 'CONST_DECL' instances for constant argument in 'acc_on_device' call.
48 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
49 b(i) = a(i) + 1
50 else
51 b(i) = a(i)
52 end if
53 end do
54 !$acc end parallel
56 #if ACC_MEM_SHARED
57 exp = 5.0
58 #else
59 exp = 4.0
60 #endif
62 do i = 1, N
63 if (b(i) .ne. exp) STOP 1
64 end do
66 a(:) = 16.0
68 !$acc parallel if (0 == 1) ! { dg-line l_compute[incr c_compute] }
69 do i = 1, N
70 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
71 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
72 b(i) = a(i) + 1
73 else
74 b(i) = a(i)
75 end if
76 end do
77 !$acc end parallel
79 do i = 1, N
80 if (b(i) .ne. 17.0) STOP 2
81 end do
83 a(:) = 8.0
85 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (one == 1) ! { dg-line l_compute[incr c_compute] }
86 do i = 1, N
87 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
88 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
89 b(i) = a(i) + 1
90 else
91 b(i) = a(i)
92 end if
93 end do
94 !$acc end parallel
96 #if ACC_MEM_SHARED
97 exp = 9.0
98 #else
99 exp = 8.0
100 #endif
102 do i = 1, N
103 if (b(i) .ne. exp) STOP 3
104 end do
106 a(:) = 22.0
108 !$acc parallel if (zero == 1) ! { dg-line l_compute[incr c_compute] }
109 do i = 1, N
110 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
111 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
112 b(i) = a(i) + 1
113 else
114 b(i) = a(i)
115 end if
116 end do
117 !$acc end parallel
119 do i = 1, N
120 if (b(i) .ne. 23.0) STOP 4
121 end do
123 a(:) = 16.0
125 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (.TRUE.) ! { dg-line l_compute[incr c_compute] }
126 do i = 1, N
127 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
128 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
129 b(i) = a(i) + 1
130 else
131 b(i) = a(i)
132 end if
133 end do
134 !$acc end parallel
136 #if ACC_MEM_SHARED
137 exp = 17.0;
138 #else
139 exp = 16.0;
140 #endif
142 do i = 1, N
143 if (b(i) .ne. exp) STOP 5
144 end do
146 a(:) = 76.0
148 !$acc parallel if (.FALSE.) ! { dg-line l_compute[incr c_compute] }
149 do i = 1, N
150 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
151 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
152 b(i) = a(i) + 1
153 else
154 b(i) = a(i)
155 end if
156 end do
157 !$acc end parallel
159 do i = 1, N
160 if (b(i) .ne. 77.0) STOP 6
161 end do
163 a(:) = 22.0
165 nn = 1
167 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (nn == 1) ! { dg-line l_compute[incr c_compute] }
168 do i = 1, N
169 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
170 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
171 b(i) = a(i) + 1
172 else
173 b(i) = a(i)
174 end if
175 end do
176 !$acc end parallel
178 #if ACC_MEM_SHARED
179 exp = 23.0;
180 #else
181 exp = 22.0;
182 #endif
184 do i = 1, N
185 if (b(i) .ne. exp) STOP 7
186 end do
188 a(:) = 18.0
190 nn = 0
192 !$acc parallel if (nn == 1) ! { dg-line l_compute[incr c_compute] }
193 do i = 1, N
194 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
195 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
196 b(i) = a(i) + 1
197 else
198 b(i) = a(i)
199 end if
200 end do
201 !$acc end parallel
203 do i = 1, N
204 if (b(i) .ne. 19.0) STOP 8
205 end do
207 a(:) = 49.0
209 nn = 1
211 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0) ! { dg-line l_compute[incr c_compute] }
212 do i = 1, N
213 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
214 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
215 b(i) = a(i) + 1
216 else
217 b(i) = a(i)
218 end if
219 end do
220 !$acc end parallel
222 #if ACC_MEM_SHARED
223 exp = 50.0
224 #else
225 exp = 49.0
226 #endif
228 do i = 1, N
229 if (b(i) .ne. exp) STOP 9
230 end do
232 a(:) = 38.0
234 nn = 0;
236 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0) ! { dg-line l_compute[incr c_compute] }
237 do i = 1, N
238 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
239 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
240 b(i) = a(i) + 1
241 else
242 b(i) = a(i)
243 end if
244 end do
245 !$acc end parallel
247 do i = 1, N
248 if (b(i) .ne. 39.0) STOP 10
249 end do
251 a(:) = 91.0
253 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (-2 > 0) ! { dg-line l_compute[incr c_compute] }
254 do i = 1, N
255 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
256 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
257 b(i) = a(i) + 1
258 else
259 b(i) = a(i)
260 end if
261 end do
262 !$acc end parallel
264 do i = 1, N
265 if (b(i) .ne. 92.0) STOP 11
266 end do
268 a(:) = 43.0
270 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (one == 1) ! { dg-line l_compute[incr c_compute] }
271 do i = 1, N
272 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
273 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
274 b(i) = a(i) + 1
275 else
276 b(i) = a(i)
277 end if
278 end do
279 !$acc end parallel
281 #if ACC_MEM_SHARED
282 exp = 44.0
283 #else
284 exp = 43.0
285 #endif
287 do i = 1, N
288 if (b(i) .ne. exp) STOP 12
289 end do
291 a(:) = 87.0
293 !$acc parallel if (one == 0) ! { dg-line l_compute[incr c_compute] }
294 do i = 1, N
295 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
296 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
297 b(i) = a(i) + 1
298 else
299 b(i) = a(i)
300 end if
301 end do
302 !$acc end parallel
304 do i = 1, N
305 if (b(i) .ne. 88.0) STOP 13
306 end do
308 a(:) = 3.0
309 b(:) = 9.0
311 #if ACC_MEM_SHARED
312 exp = 0.0
313 exp2 = 0.0
314 #else
315 call acc_copyin (a, sizeof (a))
316 call acc_copyin (b, sizeof (b))
317 exp = 3.0;
318 exp2 = 9.0;
319 #endif
321 !$acc update device (a(1:N), b(1:N)) if (1 == 1)
323 a(:) = 0.0
324 b(:) = 0.0
326 !$acc update host (a(1:N), b(1:N)) if (1 == 1)
328 do i = 1, N
329 if (a(i) .ne. exp) STOP 14
330 if (b(i) .ne. exp2) STOP 15
331 end do
333 a(:) = 6.0
334 b(:) = 12.0
336 !$acc update device (a(1:N), b(1:N)) if (0 == 1)
338 a(:) = 0.0
339 b(:) = 0.0
341 !$acc update host (a(1:N), b(1:N)) if (1 == 1)
343 do i = 1, N
344 if (a(i) .ne. exp) STOP 16
345 if (b(i) .ne. exp2) STOP 17
346 end do
348 a(:) = 26.0
349 b(:) = 21.0
351 !$acc update device (a(1:N), b(1:N)) if (1 == 1)
353 a(:) = 0.0
354 b(:) = 0.0
356 !$acc update host (a(1:N), b(1:N)) if (0 == 1)
358 do i = 1, N
359 if (a(i) .ne. 0.0) STOP 18
360 if (b(i) .ne. 0.0) STOP 19
361 end do
363 #if !ACC_MEM_SHARED
364 call acc_copyout (a, sizeof (a))
365 call acc_copyout (b, sizeof (b))
366 #endif
368 a(:) = 4.0
369 b(:) = 0.0
371 !$acc data copyin (a(1:N)) copyout (b(1:N)) if (1 == 1)
372 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
374 !$acc parallel present (a(1:N))
375 do i = 1, N
376 b(i) = a(i)
377 end do
378 !$acc end parallel
379 !$acc end data
381 do i = 1, N
382 if (b(i) .ne. 4.0) STOP 20
383 end do
385 a(:) = 8.0
386 b(:) = 1.0
388 !$acc data copyin (a(1:N)) copyout (b(1:N)) if (0 == 1)
389 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: artificial} "" { target { ! openacc_host_selected } } .-1 }
391 #if !ACC_MEM_SHARED
392 if (acc_is_present (a) .eqv. .TRUE.) STOP 21
393 if (acc_is_present (b) .eqv. .TRUE.) STOP 22
394 #endif
396 !$acc end data
398 a(:) = 18.0
399 b(:) = 21.0
401 !$acc data copyin (a(1:N)) if (1 == 1)
402 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
403 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: artificial} "" { target { ! openacc_host_selected } } .-2 }
405 #if !ACC_MEM_SHARED
406 if (acc_is_present (a) .eqv. .FALSE.) STOP 23
407 #endif
409 !$acc data copyout (b(1:N)) if (0 == 1)
410 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
411 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: artificial} "" { target { ! openacc_host_selected } } .-2 }
412 #if !ACC_MEM_SHARED
413 if (acc_is_present (b) .eqv. .TRUE.) STOP 24
414 #endif
415 !$acc data copyout (b(1:N)) if (1 == 1)
416 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
418 !$acc parallel present (a(1:N)) present (b(1:N))
419 do i = 1, N
420 b(i) = a(i)
421 end do
422 !$acc end parallel
424 !$acc end data
426 #if !ACC_MEM_SHARED
427 if (acc_is_present (b) .eqv. .TRUE.) STOP 25
428 #endif
429 !$acc end data
430 !$acc end data
432 do i = 1, N
433 if (b(1) .ne. 18.0) STOP 26
434 end do
436 !$acc enter data copyin (b(1:N)) if (0 == 1)
438 #if !ACC_MEM_SHARED
439 if (acc_is_present (b) .eqv. .TRUE.) STOP 27
440 #endif
442 !$acc exit data delete (b(1:N)) if (0 == 1)
444 !$acc enter data copyin (b(1:N)) if (1 == 1)
446 #if !ACC_MEM_SHARED
447 if (acc_is_present (b) .eqv. .FALSE.) STOP 28
448 #endif
450 !$acc exit data delete (b(1:N)) if (1 == 1)
452 #if !ACC_MEM_SHARED
453 if (acc_is_present (b) .eqv. .TRUE.) STOP 29
454 #endif
456 !$acc enter data copyin (b(1:N)) if (zero == 1)
458 #if !ACC_MEM_SHARED
459 if (acc_is_present (b) .eqv. .TRUE.) STOP 30
460 #endif
462 !$acc exit data delete (b(1:N)) if (zero == 1)
464 !$acc enter data copyin (b(1:N)) if (one == 1)
466 #if !ACC_MEM_SHARED
467 if (acc_is_present (b) .eqv. .FALSE.) STOP 31
468 #endif
470 !$acc exit data delete (b(1:N)) if (one == 1)
472 #if !ACC_MEM_SHARED
473 if (acc_is_present (b) .eqv. .TRUE.) STOP 32
474 #endif
476 !$acc enter data copyin (b(1:N)) if (one == 0)
478 #if !ACC_MEM_SHARED
479 if (acc_is_present (b) .eqv. .TRUE.) STOP 33
480 #endif
482 !$acc exit data delete (b(1:N)) if (one == 0)
484 !$acc enter data copyin (b(1:N)) if (one == 1)
486 #if !ACC_MEM_SHARED
487 if (acc_is_present (b) .eqv. .FALSE.) STOP 34
488 #endif
490 !$acc exit data delete (b(1:N)) if (one == 1)
492 #if !ACC_MEM_SHARED
493 if (acc_is_present (b) .eqv. .TRUE.) STOP 35
494 #endif
496 a(:) = 4.0
498 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (1 == 1) ! { dg-line l_compute[incr c_compute] }
499 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
500 ! { dg-note {variable 'i' made addressable} {} { target *-*-* } l_compute$c_compute } */
501 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
502 do i = 1, N
503 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
504 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
505 b(i) = a(i) + 1
506 else
507 b(i) = a(i)
508 end if
509 end do
510 !$acc end kernels
512 #if ACC_MEM_SHARED
513 exp = 5.0
514 #else
515 exp = 4.0
516 #endif
518 do i = 1, N
519 if (b(i) .ne. exp) STOP 36
520 end do
522 a(:) = 16.0
524 !$acc kernels if (0 == 1) ! { dg-line l_compute[incr c_compute] }
525 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
526 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
527 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
528 do i = 1, N
529 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
530 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
531 b(i) = a(i) + 1
532 else
533 b(i) = a(i)
534 end if
535 end do
536 !$acc end kernels
538 do i = 1, N
539 if (b(i) .ne. 17.0) STOP 37
540 end do
542 a(:) = 8.0
544 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (one == 1) ! { dg-line l_compute[incr c_compute] }
545 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
546 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
547 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
548 do i = 1, N
549 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
550 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
551 b(i) = a(i) + 1
552 else
553 b(i) = a(i)
554 end if
555 end do
556 !$acc end kernels
558 #if ACC_MEM_SHARED
559 exp = 9.0
560 #else
561 exp = 8.0
562 #endif
564 do i = 1, N
565 if (b(i) .ne. exp) STOP 38
566 end do
568 a(:) = 22.0
570 !$acc kernels if (zero == 1) ! { dg-line l_compute[incr c_compute] }
571 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
572 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
573 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
574 do i = 1, N
575 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
576 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
577 b(i) = a(i) + 1
578 else
579 b(i) = a(i)
580 end if
581 end do
582 !$acc end kernels
584 do i = 1, N
585 if (b(i) .ne. 23.0) STOP 39
586 end do
588 a(:) = 16.0
590 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (.TRUE.) ! { dg-line l_compute[incr c_compute] }
591 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
592 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
593 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
594 do i = 1, N
595 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
596 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
597 b(i) = a(i) + 1
598 else
599 b(i) = a(i)
600 end if
601 end do
602 !$acc end kernels
604 #if ACC_MEM_SHARED
605 exp = 17.0;
606 #else
607 exp = 16.0;
608 #endif
610 do i = 1, N
611 if (b(i) .ne. exp) STOP 40
612 end do
614 a(:) = 76.0
616 !$acc kernels if (.FALSE.) ! { dg-line l_compute[incr c_compute] }
617 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
618 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
619 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
620 do i = 1, N
621 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
622 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
623 b(i) = a(i) + 1
624 else
625 b(i) = a(i)
626 end if
627 end do
628 !$acc end kernels
630 do i = 1, N
631 if (b(i) .ne. 77.0) STOP 41
632 end do
634 a(:) = 22.0
636 nn = 1
638 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (nn == 1) ! { dg-line l_compute[incr c_compute] }
639 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
640 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
641 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
642 do i = 1, N
643 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
644 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
645 b(i) = a(i) + 1
646 else
647 b(i) = a(i)
648 end if
649 end do
650 !$acc end kernels
652 #if ACC_MEM_SHARED
653 exp = 23.0;
654 #else
655 exp = 22.0;
656 #endif
658 do i = 1, N
659 if (b(i) .ne. exp) STOP 42
660 end do
662 a(:) = 18.0
664 nn = 0
666 !$acc kernels if (nn == 1) ! { dg-line l_compute[incr c_compute] }
667 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
668 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
669 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
670 do i = 1, N
671 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
672 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
673 b(i) = a(i) + 1
674 else
675 b(i) = a(i)
676 end if
677 end do
678 !$acc end kernels
680 do i = 1, N
681 if (b(i) .ne. 19.0) STOP 43
682 end do
684 a(:) = 49.0
686 nn = 1
688 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0) ! { dg-line l_compute[incr c_compute] }
689 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
690 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
691 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
692 do i = 1, N
693 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
694 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
695 b(i) = a(i) + 1
696 else
697 b(i) = a(i)
698 end if
699 end do
700 !$acc end kernels
702 #if ACC_MEM_SHARED
703 exp = 50.0
704 #else
705 exp = 49.0
706 #endif
708 do i = 1, N
709 if (b(i) .ne. exp) STOP 44
710 end do
712 a(:) = 38.0
714 nn = 0;
716 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0) ! { dg-line l_compute[incr c_compute] }
717 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
718 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
719 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
720 do i = 1, N
721 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
722 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
723 b(i) = a(i) + 1
724 else
725 b(i) = a(i)
726 end if
727 end do
728 !$acc end kernels
730 do i = 1, N
731 if (b(i) .ne. 39.0) STOP 45
732 end do
734 a(:) = 91.0
736 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (-2 > 0) ! { dg-line l_compute[incr c_compute] }
737 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
738 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
739 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
740 do i = 1, N
741 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
742 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
743 b(i) = a(i) + 1
744 else
745 b(i) = a(i)
746 end if
747 end do
748 !$acc end kernels
750 do i = 1, N
751 if (b(i) .ne. 92.0) STOP 46
752 end do
754 a(:) = 43.0
756 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (one == 1) ! { dg-line l_compute[incr c_compute] }
757 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
758 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
759 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
760 do i = 1, N
761 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
762 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
763 b(i) = a(i) + 1
764 else
765 b(i) = a(i)
766 end if
767 end do
768 !$acc end kernels
770 #if ACC_MEM_SHARED
771 exp = 44.0
772 #else
773 exp = 43.0
774 #endif
776 do i = 1, N
777 if (b(i) .ne. exp) STOP 47
778 end do
780 a(:) = 87.0
782 !$acc kernels if (one == 0) ! { dg-line l_compute[incr c_compute] }
783 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
784 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
785 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
786 do i = 1, N
787 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
788 if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
789 b(i) = a(i) + 1
790 else
791 b(i) = a(i)
792 end if
793 end do
794 !$acc end kernels
796 do i = 1, N
797 if (b(i) .ne. 88.0) STOP 48
798 end do
800 a(:) = 3.0
801 b(:) = 9.0
803 #if ACC_MEM_SHARED
804 exp = 0.0
805 exp2 = 0.0
806 #else
807 call acc_copyin (a, sizeof (a))
808 call acc_copyin (b, sizeof (b))
809 exp = 3.0;
810 exp2 = 9.0;
811 #endif
813 !$acc update device (a(1:N), b(1:N)) if (1 == 1)
815 a(:) = 0.0
816 b(:) = 0.0
818 !$acc update host (a(1:N), b(1:N)) if (1 == 1)
820 do i = 1, N
821 if (a(i) .ne. exp) STOP 49
822 if (b(i) .ne. exp2) STOP 50
823 end do
825 a(:) = 6.0
826 b(:) = 12.0
828 !$acc update device (a(1:N), b(1:N)) if (0 == 1)
830 a(:) = 0.0
831 b(:) = 0.0
833 !$acc update host (a(1:N), b(1:N)) if (1 == 1)
835 do i = 1, N
836 if (a(i) .ne. exp) STOP 51
837 if (b(i) .ne. exp2) STOP 52
838 end do
840 a(:) = 26.0
841 b(:) = 21.0
843 !$acc update device (a(1:N), b(1:N)) if (1 == 1)
845 a(:) = 0.0
846 b(:) = 0.0
848 !$acc update host (a(1:N), b(1:N)) if (0 == 1)
850 do i = 1, N
851 if (a(i) .ne. 0.0) STOP 53
852 if (b(i) .ne. 0.0) STOP 54
853 end do
855 #if !ACC_MEM_SHARED
856 call acc_copyout (a, sizeof (a))
857 call acc_copyout (b, sizeof (b))
858 #endif
860 a(:) = 4.0
861 b(:) = 0.0
863 !$acc data copyin (a(1:N)) copyout (b(1:N)) if (1 == 1)
864 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
866 !$acc kernels present (a(1:N)) ! { dg-line l_compute[incr c_compute] }
867 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
868 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
869 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
870 do i = 1, N
871 b(i) = a(i)
872 end do
873 !$acc end kernels
874 !$acc end data
876 do i = 1, N
877 if (b(i) .ne. 4.0) STOP 55
878 end do
880 a(:) = 8.0
881 b(:) = 1.0
883 !$acc data copyin (a(1:N)) copyout (b(1:N)) if (0 == 1)
884 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: artificial} "" { target { ! openacc_host_selected } } .-1 }
886 #if !ACC_MEM_SHARED
887 if (acc_is_present (a) .eqv. .TRUE.) STOP 56
888 if (acc_is_present (b) .eqv. .TRUE.) STOP 57
889 #endif
891 !$acc end data
893 a(:) = 18.0
894 b(:) = 21.0
896 !$acc data copyin (a(1:N)) if (1 == 1)
897 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
898 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: artificial} "" { target { ! openacc_host_selected } } .-2 }
900 #if !ACC_MEM_SHARED
901 if (acc_is_present (a) .eqv. .FALSE.) STOP 58
902 #endif
904 !$acc data copyout (b(1:N)) if (0 == 1)
905 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
906 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: artificial} "" { target { ! openacc_host_selected } } .-2 }
907 #if !ACC_MEM_SHARED
908 if (acc_is_present (b) .eqv. .TRUE.) STOP 59
909 #endif
910 !$acc data copyout (b(1:N)) if (1 == 1)
911 ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
913 !$acc kernels present (a(1:N)) present (b(1:N)) ! { dg-line l_compute[incr c_compute] }
914 ! { dg-note {OpenACC 'kernels' decomposition: variable 'i' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute$c_compute }
915 ! { dg-note {variable 'i' already made addressable} {} { target *-*-* } l_compute$c_compute } */
916 ! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} "" { target *-*-* } .+1 }
917 do i = 1, N
918 b(i) = a(i)
919 end do
920 !$acc end kernels
922 !$acc end data
924 #if !ACC_MEM_SHARED
925 if (acc_is_present (b) .eqv. .TRUE.) STOP 60
926 #endif
927 !$acc end data
928 !$acc end data
930 do i = 1, N
931 if (b(1) .ne. 18.0) STOP 61
932 end do
934 !$acc enter data copyin (b(1:N)) if (0 == 1)
936 #if !ACC_MEM_SHARED
937 if (acc_is_present (b) .eqv. .TRUE.) STOP 62
938 #endif
940 !$acc exit data delete (b(1:N)) if (0 == 1)
942 !$acc enter data copyin (b(1:N)) if (1 == 1)
944 #if !ACC_MEM_SHARED
945 if (acc_is_present (b) .eqv. .FALSE.) STOP 63
946 #endif
948 !$acc exit data delete (b(1:N)) if (1 == 1)
950 #if !ACC_MEM_SHARED
951 if (acc_is_present (b) .eqv. .TRUE.) STOP 64
952 #endif
954 !$acc enter data copyin (b(1:N)) if (zero == 1)
956 #if !ACC_MEM_SHARED
957 if (acc_is_present (b) .eqv. .TRUE.) STOP 65
958 #endif
960 !$acc exit data delete (b(1:N)) if (zero == 1)
962 !$acc enter data copyin (b(1:N)) if (one == 1)
964 #if !ACC_MEM_SHARED
965 if (acc_is_present (b) .eqv. .FALSE.) STOP 66
966 #endif
968 !$acc exit data delete (b(1:N)) if (one == 1)
970 #if !ACC_MEM_SHARED
971 if (acc_is_present (b) .eqv. .TRUE.) STOP 67
972 #endif
974 !$acc enter data copyin (b(1:N)) if (one == 0)
976 #if !ACC_MEM_SHARED
977 if (acc_is_present (b) .eqv. .TRUE.) STOP 68
978 #endif
980 !$acc exit data delete (b(1:N)) if (one == 0)
982 !$acc enter data copyin (b(1:N)) if (one == 1)
984 #if !ACC_MEM_SHARED
985 if (acc_is_present (b) .eqv. .FALSE.) STOP 69
986 #endif
988 !$acc exit data delete (b(1:N)) if (one == 1)
990 #if !ACC_MEM_SHARED
991 if (acc_is_present (b) .eqv. .TRUE.) STOP 70
992 #endif
994 end program main