[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Semantics / final03.f90
blob3c402540152bc4cd38d1e8c3a17cb0f794e463cb
1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic -Werror
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 !PORTABILITY: Variable 'x1([INTEGER(8)::1_8])' has a vector subscript and will be finalized by non-elemental subroutine 'finalarr'
24 x1([1]) = pdt(1)()
25 x2([1]) = pdt(2)() ! ok, doesn't match either
26 x3([1]) = pdt(3)() ! ok, calls finalElem
27 end