[Flang][RISCV] Set vscale_range based off zvl*b (#77277)
[llvm-project.git] / flang / test / Semantics / final03.f90
blobc4013efb424ebdc32a5eda94c240acf1bba11312
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! PDT sensitivity of FINAL subroutines
3 module m
4 type :: pdt(k)
5 integer, kind :: k
6 contains
7 final :: finalArr, finalElem
8 end type
9 contains
10 subroutine finalArr(x)
11 type(pdt(1)), intent(in out) :: x(:)
12 end
13 elemental subroutine finalElem(x)
14 type(pdt(3)), intent(in out) :: x
15 end
16 end
18 program test
19 use m
20 type(pdt(1)) x1(1)
21 type(pdt(2)) x2(1)
22 type(pdt(3)) x3(1)
23 !ERROR: Left-hand side of assignment is not definable
24 !BECAUSE: Variable 'x1([INTEGER(8)::1_8])' has a vector subscript and cannot be finalized by non-elemental subroutine 'finalarr'
25 x1([1]) = pdt(1)()
26 x2([1]) = pdt(2)() ! ok, doesn't match either
27 x3([1]) = pdt(3)() ! ok, calls finalElem
28 end