1 ! RUN: %python %S/test_errors.py %s %flang_fc1
7 final
:: impureSubRank1
8 final
:: impureSubRank2
13 impure
subroutine impureSub(x
)
14 type(impureFinal
), intent(in
) :: x
17 impure
subroutine impureSubRank1(x
)
18 type(impureFinal
), intent(in
) :: x(:)
21 impure
subroutine impureSubRank2(x
)
22 type(impureFinal
), intent(in
) :: x(:,:)
28 type(impureFinal
), allocatable
:: ifVar
, ifvar1
29 type(impureFinal
), allocatable
:: ifArr1(:), ifArr2(:,:)
30 type(impureFinal
) :: if0
34 allocate(ifArr1(5), ifArr2(5,5))
36 ! Error to invoke an IMPURE FINAL procedure in a FORALL
38 !WARNING: FORALL index variable 'i' not used on left-hand side of assignment
39 !ERROR: Impure procedure 'impuresub' is referenced by finalization in a FORALL
44 !ERROR: Impure procedure 'impuresub' is referenced by finalization in a FORALL
49 !WARNING: FORALL index variable 'i' not used on left-hand side of assignment
50 !ERROR: Impure procedure 'impuresubrank1' is referenced by finalization in a FORALL
55 !ERROR: Impure procedure 'impuresubrank1' is referenced by finalization in a FORALL
60 !WARNING: FORALL index variable 'i' not used on left-hand side of assignment
61 !ERROR: Impure procedure 'impuresubrank2' is referenced by finalization in a FORALL