brintos

brintos / llvm-project-archived public Read only

0
0
Text · 743 B · 15335b2 Raw
28 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic -Werror2! PDT sensitivity of FINAL subroutines3module m4  type :: pdt(k)5    integer, kind :: k6   contains7    final :: finalArr, finalElem8  end type9 contains10  subroutine finalArr(x)11    type(pdt(1)), intent(in out) :: x(:)12  end13  elemental subroutine finalElem(x)14    type(pdt(3)), intent(in out) :: x15  end16end17 18program test19  use m20  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' [-Wvector-subscript-finalization]24  x1([1]) = pdt(1)()25  x2([1]) = pdt(2)() ! ok, doesn't match either26  x3([1]) = pdt(3)() ! ok, calls finalElem27end28