[flang] Test for constraint C1127
The DEFAULT ( NONE ) locality-spec shall not appear more than once in a given concurrent-locality. Original-commit: flang-compiler/f18@fcca28ef3c Reviewed-on: https://github.com/flang-compiler/f18/pull/513 Tree-same-pre-rewrite: false
This commit is contained in:
parent
cf1789e602
commit
db1ba910c5
|
@ -126,6 +126,7 @@ set(ERROR_TESTS
|
|||
dosemantics02.f90
|
||||
dosemantics03.f90
|
||||
dosemantics04.f90
|
||||
dosemantics05.f90
|
||||
expr-errors01.f90
|
||||
null01.f90
|
||||
equivalence01.f90
|
||||
|
|
31
flang/test/semantics/dosemantics05.f90
Normal file
31
flang/test/semantics/dosemantics05.f90
Normal file
|
@ -0,0 +1,31 @@
|
|||
! Copyright (c) 2019, 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.
|
||||
|
||||
! C1127 -- The DEFAULT (NONE) locality-spec shall not appear more than once in a
|
||||
! given concurrent-locality.
|
||||
PROGRAM dosemantics05
|
||||
IMPLICIT NONE
|
||||
INTEGER :: ivar
|
||||
|
||||
! This one works
|
||||
DO CONCURRENT (ivar = 1:10) DEFAULT (NONE)
|
||||
PRINT *, "ivar is: ", ivar
|
||||
END DO
|
||||
|
||||
!ERROR: only one DEFAULT(NONE) may appear
|
||||
DO CONCURRENT (ivar = 1:10) DEFAULT (NONE) DEFAULT (NONE)
|
||||
PRINT *, "ivar is: ", ivar
|
||||
END DO
|
||||
|
||||
END PROGRAM dosemantics05
|
Loading…
Reference in a new issue