PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / goacc / kernels-loop-data.f95
blob94522f586362eebc00015ebcae80e132b4f10902
1 ! { dg-additional-options "-O2" }
2 ! { dg-additional-options "-fdump-tree-parloops1-all" }
3 ! { dg-additional-options "-fdump-tree-optimized" }
5 program main
6 implicit none
7 integer, parameter :: n = 1024
8 integer, dimension (0:n-1) :: a, b, c
9 integer :: i, ii
11 !$acc data copyout (a(0:n-1), b(0:n-1), c(0:n-1))
13 !$acc kernels present (a(0:n-1))
14 do i = 0, n - 1
15 a(i) = i * 2
16 end do
17 !$acc end kernels
19 !$acc kernels present (b(0:n-1))
20 do i = 0, n -1
21 b(i) = i * 4
22 end do
23 !$acc end kernels
25 !$acc kernels present (a(0:n-1), b(0:n-1), c(0:n-1))
26 do ii = 0, n - 1
27 c(ii) = a(ii) + b(ii)
28 end do
29 !$acc end kernels
31 !$acc end data
33 do i = 0, n - 1
34 if (c(i) .ne. a(i) + b(i)) STOP 1
35 end do
37 end program main
39 ! Check that only three loops are analyzed, and that all can be parallelized.
40 ! { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops1" } }
41 ! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 3 "parloops1" } }
42 ! { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } }
44 ! Check that the loop has been split off into a function.
45 ! { dg-final { scan-tree-dump-times "(?n);; Function MAIN__._omp_fn.0 " 1 "optimized" } }
46 ! { dg-final { scan-tree-dump-times "(?n);; Function MAIN__._omp_fn.1 " 1 "optimized" } }
47 ! { dg-final { scan-tree-dump-times "(?n);; Function MAIN__._omp_fn.2 " 1 "optimized" } }