Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / pr70643.f90
blob5082e367e020c71ebc3100e3668f1a2145ddf27a
1 ! { dg-do run }
3 ! { dg-additional-options -Wuninitialized }
5 MODULE reduction_test
7 CONTAINS
9 SUBROUTINE reduction_kernel(x_min,x_max,y_min,y_max,arr,sum)
11 IMPLICIT NONE
13 INTEGER :: x_min,x_max,y_min,y_max
14 REAL(KIND=8), DIMENSION(x_min-2:x_max+2,y_min-2:y_max+2) :: arr
15 REAL(KIND=8) :: sum
17 INTEGER :: j,k
19 !$ACC DATA PRESENT(arr) COPY(sum)
20 !$ACC PARALLEL LOOP REDUCTION(+ : sum)
21 ! { dg-bogus {'sum\.[0-9]+' is used uninitialized} TODO { xfail *-*-* } .-1 }
22 ! { dg-note {'sum\.[0-9]+' was declared here} {} { target *-*-* } .-2 }
23 DO k=y_min,y_max
24 DO j=x_min,x_max
25 sum=sum+arr(j,k)
26 ENDDO
27 ENDDO
28 !$ACC END PARALLEL LOOP
29 !$ACC END DATA
30 END SUBROUTINE reduction_kernel
32 END MODULE reduction_test
34 program main
35 use reduction_test
37 integer :: x_min,x_max,y_min,y_max
38 real(kind=8), dimension(1:10,1:10) :: arr
39 real(kind=8) :: sum
41 x_min = 1
42 x_max = 2
43 y_min = 1
44 y_max = 2
46 arr(:,:) = 1.0
48 sum = 0.0
50 !$acc data copy(arr)
52 call reduction_kernel(x_min,x_max,y_min,y_max,arr,sum)
54 !$acc end data
56 if (sum .ne. 4.0) STOP 1
57 end program