llvm/flang/test/semantics/doconcurrent02.f90
Eric Schweitz 30c7c99d54 [flang] Add more constraint checking for DO CONCURRENT.
Add some more tests.

Original-commit: flang-compiler/f18@e65f755fe1
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00

55 lines
1.7 KiB
Fortran

! Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
!
! Licensed under the Apache License, Version 2.0 (the "License");
! you may not use this file except in compliance with the License.
! You may obtain a copy of the License at
!
! http://www.apache.org/licenses/LICENSE-2.0
!
! Unless required by applicable law or agreed to in writing, software
! distributed under the License is distributed on an "AS IS" BASIS,
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! See the License for the specific language governing permissions and
! limitations under the License.
! negative tests: we don't want DO CONCURRENT semantics constraints checked
! when the loops are not DO CONCURRENT
! RUN: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK-NOT: image control statement not allowed in DO CONCURRENT
! CHECK-NOT: RETURN not allowed in DO CONCURRENT
! CHECK-NOT: call to impure subroutine in DO CONCURRENT not allowed
! CHECK-NOT: IEEE_GET_FLAG not allowed in DO CONCURRENT
! CHECK-NOT: ADVANCE specifier not allowed in DO CONCURRENT
! CHECK-NOT: SYNC ALL
! CHECK-NOT: SYNC IMAGES
module ieee_exceptions
interface
subroutine ieee_get_flag(i, j)
integer :: i, j
end subroutine ieee_get_flag
end interface
end module ieee_exceptions
subroutine do_concurrent_test1(i,n)
implicit none
integer :: i, n
do 10 i = 1,n
SYNC ALL
SYNC IMAGES (*)
return
10 continue
end subroutine do_concurrent_test1
subroutine do_concurrent_test2(i,j,n,flag)
use ieee_exceptions
implicit none
integer :: i, j, n, flag, flag2
do i = 1,n
change team (j)
call ieee_get_flag(flag, flag2)
end team
write(*,'(a35)',advance='no')
end do
end subroutine do_concurrent_test2