80 lines · plain
1!RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s2module m3 type :: t14 integer :: n5 contains6 final :: t1f0, t1f17 end type8 type :: t29 integer :: n10 contains11 final :: t2fe12 end type13 type :: t314 integer :: n15 contains16 final :: t3far17 end type18 type, extends(t1) :: t419 end type20 type :: t521 !CHECK-NOT: 'scalar' of derived type 't1'22 type(t1) :: scalar23 !CHECK-NOT: 'vector' of derived type 't1'24 type(t1) :: vector(2)25 !CHECK: 'matrix' of derived type 't1' does not have a FINAL subroutine for its rank (2)26 type(t1) :: matrix(2, 2)27 end type28 type :: t629 integer :: n30 contains31 final :: t6f332 end type33 contains34 subroutine t1f0(x)35 type(t1) :: x36 end subroutine37 subroutine t1f1(x)38 type(t1) :: x(:)39 end subroutine40 impure elemental subroutine t2fe(x)41 type(t2), intent(in out) :: x42 end subroutine43 subroutine t3far(x)44 type(t3) :: x(..)45 end subroutine46 subroutine t6f3(x)47 type(t6) :: x(:,:,:)48 end subroutine49end module50 51subroutine test(assumedRank) ! *not* a main program, since they don't finalize locals52 use m53 !CHECK-NOT: 'scalar1' of derived type 't1'54 type(t1) :: scalar155 !CHECK-NOT: 'vector1' of derived type 't1'56 type(t1) :: vector1(2)57 !CHECK: 'matrix1' of derived type 't1' does not have a FINAL subroutine for its rank (2)58 type(t1) :: matrix1(2,2)59 !CHECK-NOT: 'scalar2' of derived type 't2'60 type(t2) :: scalar261 !CHECK-NOT: 'vector2' of derived type 't2'62 type(t2) :: vector2(2)63 !CHECK-NOT: 'matrix2' of derived type 't2'64 type(t2) :: matrix2(2,2)65 !CHECK-NOT: 'scalar3' of derived type 't3'66 type(t3) :: scalar367 !CHECK-NOT: 'vector3' of derived type 't3'68 type(t3) :: vector3(2)69 !CHECK-NOT: 'matrix3' of derived type 't2'70 type(t3) :: matrix3(2,2)71 !CHECK-NOT: 'scalar4' of derived type 't4'72 type(t4) :: scalar473 !CHECK-NOT: 'vector4' of derived type 't4'74 type(t4) :: vector4(2)75 !CHECK: 'matrix4' of derived type 't4' extended from 't1' does not have a FINAL subroutine for its rank (2)76 type(t4) :: matrix4(2,2)77 !CHECK-NOT: 'assumedRank' of derived type 't6'78 type(t6) :: assumedRank(..)79end80