brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · d082981 Raw
65 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Test constant folding of type parameter values both a base value and a3! parameter name are supplied.4! 5! Type parameters are described in 7.5.3 and constant expressions are described 6! in 10.1.12.  10.1.12, paragraph 4 defines whether a specification inquiry is 7! a constant expression.  Section 10.1.11, paragraph 3, item (2) states that a 8! type parameter inquiry is a specification inquiry.  9 10module m111  type dtype(goodDefaultKind, badDefaultKind)12    integer, kind :: goodDefaultKind = 413    integer, kind :: badDefaultKind = 34314    ! next field OK only if instantiated with a good value of goodDefaultKind15    !ERROR: KIND parameter value (99) of intrinsic type REAL did not resolve to a supported value16    real(goodDefaultKind) :: goodDefaultField17    ! next field OK only if instantiated with a good value of goodDefaultKind18    !ERROR: KIND parameter value (343) of intrinsic type REAL did not resolve to a supported value19    !ERROR: KIND parameter value (99) of intrinsic type REAL did not resolve to a supported value20    real(badDefaultKind) :: badDefaultField21  end type dtype22  type(dtype) :: v123  type(dtype(4, 4)) :: v224  type(dtype(99, 4)) :: v325  type(dtype(4, 99)) :: v426end module m127 28module m229  type baseType(baseParam)30    integer, kind :: baseParam = 431  end type baseType32  type dtype(dtypeParam)33    integer, kind :: dtypeParam = 434    type(baseType(dtypeParam)) :: baseField35    !ERROR: KIND parameter value (343) of intrinsic type REAL did not resolve to a supported value36    real(dtypeParam) :: realField37  end type dtype38 39  type(dtype) :: v140  type(dtype(8)) :: v241  type(dtype(343)) :: v342end module m243 44module m345  type dtype(goodDefaultLen, badDefaultLen)46    integer, len :: goodDefaultLen = 447    integer, len :: badDefaultLen = 34348  end type dtype49  type(dtype) :: v150  type(dtype(4, 4)) :: v251  type(dtype(99, 4)) :: v352  type(dtype(4, 99)) :: v453  real(v1%goodDefaultLen), pointer :: pGood154  !ERROR: REAL(KIND=343) is not a supported type55  real(v1%badDefaultLen), pointer :: pBad156  real(v2%goodDefaultLen), pointer :: pGood257  real(v2%badDefaultLen), pointer :: pBad258  !ERROR: REAL(KIND=99) is not a supported type59  real(v3%goodDefaultLen), pointer :: pGood360  real(v3%badDefaultLen), pointer :: pBad361  real(v4%goodDefaultLen), pointer :: pGood462  !ERROR: REAL(KIND=99) is not a supported type63  real(v4%badDefaultLen), pointer :: pBad464end module m365