File: resolve88.f90

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (76 lines) | stat: -rw-r--r-- 3,164 bytes parent folder | download | duplicates (3)
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
70
71
72
73
74
75
76
! RUN: %S/test_errors.sh %s %t %flang_fc1
! REQUIRES: shell
! C746, C747, and C748
module m
  use ISO_FORTRAN_ENV
  use ISO_C_BINDING

  ! C746 If a coarray-spec appears, it shall be a deferred-coshape-spec-list and
  ! the component shall have the ALLOCATABLE attribute.

  type testCoArrayType
    real, allocatable, codimension[:] :: allocatableField
    !ERROR: Component 'deferredfield' is a coarray and must have the ALLOCATABLE attribute
    real, codimension[:] :: deferredField
    !ERROR: Component 'pointerfield' is a coarray and must have the ALLOCATABLE attribute
    !ERROR: 'pointerfield' may not have the POINTER attribute because it is a coarray
    real, pointer, codimension[:] :: pointerField
    !ERROR: Component 'realfield' is a coarray and must have the ALLOCATABLE attribute and have a deferred coshape
    real, codimension[*] :: realField
    !ERROR: 'realfield2' is an ALLOCATABLE coarray and must have a deferred coshape
    real, allocatable, codimension[*] :: realField2
  end type testCoArrayType

  ! C747 If a coarray-spec appears, the component shall not be of type C_PTR or
  ! C_FUNPTR from the intrinsic module ISO_C_BINDING (18.2), or of type 
  ! TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV (16.10.2).

  type goodCoarrayType
    real, allocatable, codimension[:] :: field
  end type goodCoarrayType

  type goodTeam_typeCoarrayType
    type(team_type), allocatable :: field
  end type goodTeam_typeCoarrayType

  type goodC_ptrCoarrayType
    type(c_ptr), allocatable :: field
  end type goodC_ptrCoarrayType

  type goodC_funptrCoarrayType
    type(c_funptr), allocatable :: field
  end type goodC_funptrCoarrayType

  type team_typeCoarrayType
    !ERROR: A coarray component may not be of type TEAM_TYPE from ISO_FORTRAN_ENV
    type(team_type), allocatable, codimension[:] :: field
  end type team_typeCoarrayType

  type c_ptrCoarrayType
    !ERROR: A coarray component may not be of type C_PTR or C_FUNPTR from ISO_C_BINDING
    type(c_ptr), allocatable, codimension[:] :: field
  end type c_ptrCoarrayType

  type c_funptrCoarrayType
    !ERROR: A coarray component may not be of type C_PTR or C_FUNPTR from ISO_C_BINDING
    type(c_funptr), allocatable, codimension[:] :: field
  end type c_funptrCoarrayType

! C748 A data component whose type has a coarray ultimate component shall be a
! nonpointer nonallocatable scalar and shall not be a coarray.

  type coarrayType
    real, allocatable, codimension[:] :: goodCoarrayField
  end type coarrayType

  type testType
    type(coarrayType) :: goodField
    !ERROR: A component with a POINTER or ALLOCATABLE attribute may not be of a type with a coarray ultimate component (named 'goodcoarrayfield')
    type(coarrayType), pointer :: pointerField
    !ERROR: A component with a POINTER or ALLOCATABLE attribute may not be of a type with a coarray ultimate component (named 'goodcoarrayfield')
    type(coarrayType), allocatable :: allocatableField
    !ERROR: An array or coarray component may not be of a type with a coarray ultimate component (named 'goodcoarrayfield')
    type(coarrayType), dimension(3) :: arrayField
  end type testType

end module m