File: final02.f90

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (69 lines) | stat: -rw-r--r-- 1,925 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
!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), intent(in out) :: x
  end subroutine
  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