forked from OSchip/llvm-project
[flang] Finish up
Original-commit: flang-compiler/f18@8c8242e6f4 Reviewed-on: https://github.com/flang-compiler/f18/pull/406 Tree-same-pre-rewrite: false
This commit is contained in:
parent
7243929103
commit
3484149aa7
|
@ -2526,7 +2526,7 @@ void DeclarationVisitor::CheckScalarIntegerType(const parser::Name &name) {
|
|||
}
|
||||
if (auto *type{symbol.GetType()}) {
|
||||
if (!type->IsNumeric(TypeCategory::Integer)) {
|
||||
Say(name, "Variable '%s' is not integer"_err_en_US);
|
||||
Say(name, "Variable '%s' is not INTEGER"_err_en_US);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,6 +93,7 @@ set(ERROR_TESTS
|
|||
nullify02.f90
|
||||
deallocate01.f90
|
||||
deallocate04.f90
|
||||
deallocate05.f90
|
||||
)
|
||||
|
||||
# These test files have expected symbols in the source
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
! See the License for the specific language governing permissions and
|
||||
! limitations under the License.
|
||||
|
||||
! Check for semantic errors in DEALLOCATE statements
|
||||
! Check for type errors in DEALLOCATE statements
|
||||
|
||||
INTEGER, PARAMETER :: maxvalue=1024
|
||||
|
||||
|
@ -23,7 +23,7 @@ Type t
|
|||
Type(dt) :: p
|
||||
End Type
|
||||
|
||||
Type(t),Allocatable :: x(:)
|
||||
Type(t),Allocatable :: x
|
||||
|
||||
Real :: r
|
||||
Integer :: s
|
||||
|
@ -32,47 +32,13 @@ Integer :: pi
|
|||
Character(256) :: ee
|
||||
Procedure(Real) :: prp
|
||||
|
||||
Allocate(x(3))
|
||||
Allocate(x)
|
||||
|
||||
!ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
Deallocate(x(2)%p)
|
||||
!ERROR: Must have CHARACTER type, but is INTEGER(4)
|
||||
Deallocate(x, stat=s, errmsg=e)
|
||||
|
||||
!ERROR: name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
Deallocate(pi)
|
||||
|
||||
!ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
!ERROR: name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
Deallocate(x(2)%p, pi)
|
||||
|
||||
!ERROR: name in DEALLOCATE statement must be a variable name
|
||||
Deallocate(prp)
|
||||
|
||||
!ERROR: name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
!ERROR: name in DEALLOCATE statement must be a variable name
|
||||
Deallocate(pi, prp)
|
||||
|
||||
!ERROR: name in DEALLOCATE statement must be a variable name
|
||||
Deallocate(maxvalue)
|
||||
|
||||
!ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
Deallocate(x%p)
|
||||
|
||||
!ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
!ERROR: Must have default CHARACTER type
|
||||
Deallocate(x%p, stat=s, errmsg=e)
|
||||
|
||||
!ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
!ERROR: Must have INTEGER type
|
||||
!ERROR: Must have default CHARACTER type
|
||||
Deallocate(x%p, stat=r, errmsg=e)
|
||||
|
||||
!ERROR: STAT may not be duplicated in a DEALLOCATE statement
|
||||
Deallocate(x, stat=s, stat=s)
|
||||
!ERROR: ERRMSG may not be duplicated in a DEALLOCATE statement
|
||||
Deallocate(x, errmsg=ee, errmsg=ee)
|
||||
!ERROR: STAT may not be duplicated in a DEALLOCATE statement
|
||||
Deallocate(x, stat=s, errmsg=ee, stat=s)
|
||||
!ERROR: ERRMSG may not be duplicated in a DEALLOCATE statement
|
||||
Deallocate(x, stat=s, errmsg=ee, errmsg=ee)
|
||||
!ERROR: Must have INTEGER type, but is REAL(4)
|
||||
!ERROR: Must have CHARACTER type, but is INTEGER(4)
|
||||
Deallocate(x, stat=r, errmsg=e)
|
||||
|
||||
End Program
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
! 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.
|
||||
|
||||
! Check for semantic errors in DEALLOCATE statements
|
||||
|
||||
INTEGER, PARAMETER :: maxvalue=1024
|
||||
|
||||
Type dt
|
||||
Integer :: l = 3
|
||||
End Type
|
||||
Type t
|
||||
Type(dt) :: p
|
||||
End Type
|
||||
|
||||
Type(t),Allocatable :: x(:)
|
||||
|
||||
Real :: r
|
||||
Integer :: s
|
||||
Integer :: e
|
||||
Integer :: pi
|
||||
Character(256) :: ee
|
||||
Procedure(Real) :: prp
|
||||
|
||||
Allocate(x(3))
|
||||
|
||||
!ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
Deallocate(x(2)%p)
|
||||
|
||||
!ERROR: name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
Deallocate(pi)
|
||||
|
||||
!ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
!ERROR: name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
Deallocate(x(2)%p, pi)
|
||||
|
||||
!ERROR: name in DEALLOCATE statement must be a variable name
|
||||
Deallocate(prp)
|
||||
|
||||
!ERROR: name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
!ERROR: name in DEALLOCATE statement must be a variable name
|
||||
Deallocate(pi, prp)
|
||||
|
||||
!ERROR: name in DEALLOCATE statement must be a variable name
|
||||
Deallocate(maxvalue)
|
||||
|
||||
!ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
||||
Deallocate(x%p)
|
||||
|
||||
!ERROR: STAT may not be duplicated in a DEALLOCATE statement
|
||||
Deallocate(x, stat=s, stat=s)
|
||||
!ERROR: ERRMSG may not be duplicated in a DEALLOCATE statement
|
||||
Deallocate(x, errmsg=ee, errmsg=ee)
|
||||
!ERROR: STAT may not be duplicated in a DEALLOCATE statement
|
||||
Deallocate(x, stat=s, errmsg=ee, stat=s)
|
||||
!ERROR: ERRMSG may not be duplicated in a DEALLOCATE statement
|
||||
Deallocate(x, stat=s, errmsg=ee, errmsg=ee)
|
||||
|
||||
End Program
|
|
@ -13,10 +13,11 @@
|
|||
! limitations under the License.
|
||||
|
||||
! RUN: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
|
||||
! CHECK: must have INTEGER type, but is REAL(4)
|
||||
! CHECK: Variable 'j' is not INTEGER
|
||||
|
||||
subroutine do_concurrent_test1(i,n)
|
||||
subroutine do_concurrent_test1(n)
|
||||
implicit none
|
||||
integer :: n
|
||||
real :: j
|
||||
do 20 concurrent (j = 1:n)
|
||||
20 enddo
|
||||
|
|
Loading…
Reference in New Issue