aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/goacc/omp.f95
blob: d8bd886ad9c0e6a19ccefe827c5f7887f111613e (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
! { dg-do compile } 
! { dg-additional-options "-fopenmp" } 

module test
contains
  subroutine ichi
    implicit none
    integer :: i
    !$acc parallel
    !$omp do ! { dg-error "cannot be specified" }
    do i = 1,5
    enddo
    !$acc end parallel
  end subroutine ichi

  subroutine ni
    implicit none
    integer :: i
    !$omp parallel
    !$acc loop ! { dg-error "cannot be specified" }
    do i = 1,5
    enddo
    !$omp end parallel
  end subroutine ni

  subroutine san
    implicit none
    integer :: i
    !$omp do
    !$acc loop ! { dg-error "Unexpected" }
    do i = 1,5
    enddo
   end subroutine san

   subroutine yon
     implicit none
     integer :: i
     !$acc loop
     !$omp do ! { dg-error "Expected DO loop" }
     do i = 1,5
     enddo
   end subroutine yon

   subroutine go
     implicit none
     integer :: i, j

     !$omp parallel
     do i = 1,5
       !$acc kernels ! { dg-error "cannot be specified" }
       do j = 1,5
       enddo
       !$acc end kernels
     enddo
     !$omp end parallel
   end subroutine go

   subroutine roku
     implicit none

     !$acc data
     !$omp parallel ! { dg-error "cannot be specified" }
     !$omp end parallel
     !$acc end data
   end subroutine roku

   subroutine nana
     !$acc parallel &
     !$omp do ! { dg-error "Wrong OpenACC continuation" }
     do i = 1, 5 ! { dg-error "The !.OMP DO directive cannot be specified within a !.ACC PARALLEL region" "" { target *-*-* } .-1 }
     end do
     !$acc end parallel

     !$omp parallel &
     !$acc kernels loop ! { dg-error "Wrong OpenMP continuation" }
     do i = 1, 5 ! { dg-error "The !.ACC KERNELS LOOP directive cannot be specified within a !.OMP PARALLEL region" "" { target *-*-* } .-1 }
     end do
     !$omp end parallel

     !$omp parallel &
     !$acc loop ! { dg-error "Wrong OpenMP continuation" }
     do i = 1, 5 ! { dg-error "The !.ACC LOOP directive cannot be specified within a !.OMP PARALLEL region" "" { target *-*-* } .-1 }
     end do
     !$omp end parallel
   end subroutine nana
end module test