[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / resolve90.f90
blob12467341a97e64af938b3682e5818e4147ea0012
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Testing for pointer constant, along with :
3 ! C751 A component shall not have both the ALLOCATABLE and POINTER attributes.
4 ! C752 If the CONTIGUOUS attribute is specified, the component shall be an
5 ! array with the POINTER attribute.
6 ! C753 The * char-length option is permitted only if the component is of type
7 ! character.
8 subroutine s()
9 !ERROR: 'nullint' may not have both the POINTER and PARAMETER attributes
10 integer, pointer, parameter :: nullint => null()
11 type derivedType
12 !ERROR: 'pointerallocatablefield' may not have both the POINTER and ALLOCATABLE attributes
13 real, pointer, allocatable :: pointerAllocatableField
14 real, dimension(:), contiguous, pointer :: goodContigField
15 !ERROR: A CONTIGUOUS component must be an array with the POINTER attribute
16 real, dimension(:), contiguous, allocatable :: badContigField
17 character :: charField * 3
18 !ERROR: A length specifier cannot be used to declare the non-character entity 'realfield'
19 real :: realField * 3
20 end type derivedType
21 end subroutine s