Files
clang-p2996/flang/test/Semantics/final02.f90
Andrzej Warzynski e7be90bd27 [flang] Update the regression tests to use the new driver when enabled
This patch updates most of the remaining regression tests (~400) to use
`flang-new` rather then `f18` when `FLANG_BUILD_NEW_DRIVER` is set.
This allows us to share more Flang regression tests between `f18` and
`flang-new`. A handful of tests have not been ported yet - these are
currently either failing or not supported by the new driver.

Summary of changes:
  * RUN lines in tests are updated to use `%flang_fc1` instead of `%f18`
  * option spellings in tests are updated to forms accepted by both `f18` and
    `flang-new`
  * variables in Bash scripts are renamed (e.g. F18 --> FLANG_FC1)
The updated tests will now be run with the new driver, `flang-new`,
whenever it is enabled (i.e when `FLANG_BUILD_NEW_DRIVER` is set).

Although this patch touches many files, vast majority of the changes are
automatic:
```
grep -IEZlr "%f18" flang/test/ | xargs -0 -l sed -i 's/%f18/%flang_fc1/g
```

Differential Revision: https://reviews.llvm.org/D100309
2021-04-15 08:52:23 +00:00

70 lines
1.9 KiB
Fortran

!RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
module m
type :: t1
integer :: n
contains
final :: t1f0, t1f1
end type
type :: t2
integer :: n
contains
final :: t2fe
end type
type :: t3
integer :: n
contains
final :: t3far
end type
type, extends(t1) :: t4
end type
type :: t5
!CHECK-NOT: 'scalar' of derived type 't1'
type(t1) :: scalar
!CHECK-NOT: 'vector' of derived type 't1'
type(t1) :: vector(2)
!CHECK: 'matrix' of derived type 't1' does not have a FINAL subroutine for its rank (2)
type(t1) :: matrix(2, 2)
end type
contains
subroutine t1f0(x)
type(t1) :: x
end subroutine
subroutine t1f1(x)
type(t1) :: x(:)
end subroutine
impure elemental subroutine t2fe(x)
type(t2) :: x
end subroutine
impure elemental subroutine t3far(x)
type(t3) :: x(..)
end subroutine
end module
subroutine test ! *not* a main program, since they don't finalize locals
use m
!CHECK-NOT: 'scalar1' of derived type 't1'
type(t1) :: scalar1
!CHECK-NOT: 'vector1' of derived type 't1'
type(t1) :: vector1(2)
!CHECK: 'matrix1' of derived type 't1' does not have a FINAL subroutine for its rank (2)
type(t1) :: matrix1(2,2)
!CHECK-NOT: 'scalar2' of derived type 't2'
type(t2) :: scalar2
!CHECK-NOT: 'vector2' of derived type 't2'
type(t2) :: vector2(2)
!CHECK-NOT: 'matrix2' of derived type 't2'
type(t2) :: matrix2(2,2)
!CHECK-NOT: 'scalar3' of derived type 't3'
type(t3) :: scalar3
!CHECK-NOT: 'vector3' of derived type 't3'
type(t3) :: vector3(2)
!CHECK-NOT: 'matrix3' of derived type 't2'
type(t3) :: matrix3(2,2)
!CHECK-NOT: 'scalar4' of derived type 't4'
type(t4) :: scalar4
!CHECK-NOT: 'vector4' of derived type 't4'
type(t4) :: vector4(2)
!CHECK: 'matrix4' of derived type 't4' extended from 't1' does not have a FINAL subroutine for its rank (2)
type(t4) :: matrix4(2,2)
end