mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:26:48 +00:00

The compiler accepts arguments of any rank, or assumed rank, to a host of intrinsic inquiry functions. For scalars, this is correct for most of them, but the standard (and other compilers) prohibit scalar arguments to SIZE, LBOUND, and UBOUND (without DIM=). There are meaningful interpretations for these intrinsic inquiries on scalars, but since there's no portability concern here, continuing to support them would be an unjustifiable extension. Differential Revision: https://reviews.llvm.org/D146587
23 lines
633 B
Fortran
23 lines
633 B
Fortran
! RUN: %python %S/test_symbols.py %s %flang_fc1
|
|
! "Bare" uses of type parameters
|
|
!DEF: /MainProgram1/t1 DerivedType
|
|
!DEF: /MainProgram1/t1/k TypeParam INTEGER(4)
|
|
type :: t1(k)
|
|
!REF: /MainProgram1/t1/k
|
|
integer, kind :: k=666
|
|
!DEF: /MainProgram1/t1/a ObjectEntity REAL(4)
|
|
!REF: /MainProgram1/t1/k
|
|
real :: a(k)
|
|
end type t1
|
|
!REF: /MainProgram1/t1
|
|
!DEF: /MainProgram1/t2 DerivedType
|
|
type, extends(t1) :: t2
|
|
!DEF: /MainProgram1/t2/b ObjectEntity REAL(4)
|
|
!REF: /MainProgram1/t1/k
|
|
real :: b(k)
|
|
!REF: /MainProgram1/t1
|
|
!DEF: /MainProgram1/t2/x ObjectEntity TYPE(t1(k=666_4))
|
|
type(t1) :: x
|
|
end type t2
|
|
end program
|