summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/gomp/crayptr1.f90
blob: fca5606e0324ccc247df121d142a50c835394717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
! { dg-do compile }
! { dg-options "-fopenmp -fcray-pointer" }

  integer :: a, b, c, d, i
  pointer (ip1, a)
  pointer (ip2, b)
  pointer (ip3, c)
  pointer (ip4, d)

!$omp parallel shared (a)	! { dg-error "Cray pointee 'a' in SHARED clause" }
!$omp end parallel

!$omp parallel private (b)	! { dg-error "Cray pointee 'b' in PRIVATE clause" }
!$omp end parallel

!$omp parallel firstprivate (c)	! { dg-error "Cray pointee 'c' in FIRSTPRIVATE clause" }
!$omp end parallel

!$omp parallel do lastprivate (d) ! { dg-error "Cray pointee 'd' in LASTPRIVATE clause" }
  do i = 1, 10
    if (i .eq. 10) d = 1
  end do
!$omp end parallel do

!$omp parallel reduction (+: a)	! { dg-error "Cray pointee 'a' in REDUCTION clause" }
!$omp end parallel

  ip1 = loc (i)
!$omp parallel shared (ip1)
  a = 2
!$omp end parallel

!$omp parallel private (ip2, i)
  ip2 = loc (i)
  b = 1
!$omp end parallel

  ip3 = loc (i)
!$omp parallel firstprivate (ip3) ! { dg-error "Cray pointer 'ip3' in FIRSTPRIVATE clause" }
!$omp end parallel

!$omp parallel do lastprivate (ip4) ! { dg-error "Cray pointer 'ip4' in LASTPRIVATE clause" }
  do i = 1, 10
    if (i .eq. 10) ip4 = loc (i)
  end do
!$omp end parallel do

!$omp parallel reduction (+: ip1) ! { dg-error "Cray pointer 'ip1' in REDUCTION clause" }
!$omp end parallel

end