File: resolve94.f90

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (79 lines) | stat: -rw-r--r-- 3,141 bytes parent folder | download | duplicates (2)
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
77
78
79
! RUN: %python %S/test_errors.py %s %flang_fc1
! C929   No specifier shall appear more than once in a given 
!   image-selector-spec-list.
! C930 TEAM and TEAM_NUMBER shall not both appear in the same
!   image-selector-spec-list.
! C931 A stat-variable in an image-selector shall not be a coindexed object.
subroutine s1()
  use ISO_FORTRAN_ENV
  type(team_type) :: team1, team2
  real :: rCoarray[10,20,*]
  real :: rVar1, rVar2
  integer :: iVar1, iVar2
  integer, dimension(4) :: intArray
  integer :: intScalarCoarray[*]
  integer :: intCoarray[3, 4, *]
  integer :: smallIntCoarray[4, *]
  intCoVar = 343
  ! OK
  rVar1 = rCoarray[1,2,3]
  associate (x => rCoarray)
    rVar1 = x[1,2,3] ! also ok
  end associate
  !ERROR: 'rcoarray' has corank 3, but coindexed reference has 2 cosubscripts
  rVar1 = rCoarray[1,2]
  associate (x => rCoarray)
  !ERROR: 'x' has corank 3, but coindexed reference has 2 cosubscripts
    rVar1 = x[1,2]
  end associate
  !ERROR: Must have INTEGER type, but is REAL(4)
  rVar1 = rCoarray[1,2,3.4]
  !ERROR: Must have INTEGER type, but is REAL(4)
  iVar1 = smallIntCoarray[3.4]
  !ERROR: Must be a scalar value, but is a rank-1 array
  rVar1 = rCoarray[1,intArray,3]
  ! OK
  rVar1 = rCoarray[1,2,3,STAT=iVar1, TEAM=team2]
  !ERROR: Team value must be of type TEAM_TYPE from module ISO_FORTRAN_ENV
  rVar1 = rCoarray[1,2,3,STAT=iVar1, TEAM=2]
  ! OK
  rVar1 = rCoarray[1,2,3,STAT=iVar1, TEAM_NUMBER=38]
  ! OK
  rVar1 = rCoarray[1,2,3,STAT=iVar1]
  ! OK
  rVar1 = rCoarray[1,2,3,STAT=intArray(2)]
  !ERROR: Must have INTEGER type, but is REAL(4)
  rVar1 = rCoarray[1,2,3,STAT=rVar2]
  !ERROR: Must be a scalar value, but is a rank-1 array
  rVar1 = rCoarray[1,2,3,STAT=intArray]
  ! Error on C929, no specifier can appear more than once
  !ERROR: STAT variable can only be specified once
  rVar1 = rCoarray[1,2,3,STAT=iVar1, STAT=iVar2]
  ! OK
  rVar1 = rCoarray[1,2,3,TEAM=team1]
  ! Error on C929, no specifier can appear more than once
  !ERROR: TEAM value can only be specified once
  rVar1 = rCoarray[1,2,3,TEAM=team1, TEAM=team2]
  ! OK
  rVar1 = rCoarray[1,2,3,TEAM_NUMBER=37]
  ! OK
  rVar1 = rCoarray[1,2,3,TEAM_NUMBER=iVar1]
  ! Error, team number is a scalar integer expression
  !ERROR: Must be a scalar value, but is a rank-1 array
  rVar1 = rCoarray[1,2,3,TEAM_NUMBER=intArray]
  ! Error, team number is a scalar integer expression
  !ERROR: Must have INTEGER type, but is REAL(4)
  rVar1 = rCoarray[1,2,3,TEAM_NUMBER=3.7]
  ! Error on C929, no specifier can appear more than once
  !ERROR: TEAM_NUMBER value can only be specified once
  rVar1 = rCoarray[1,2,3,TEAM_NUMBER=37, TEAM_NUMBER=37]
  !ERROR: Cannot specify both TEAM and TEAM_NUMBER
  rVar1 = rCoarray[1,2,3,TEAM=team1, TEAM_NUMBER=37]
  !ERROR: Cannot specify both TEAM and TEAM_NUMBER
  rVar1 = rCoarray[1,2,3,TEAM_number=43, TEAM=team1]
  ! OK for a STAT variable to be a coarray integer
  rVar1 = rCoarray[1,2,3,stat=intScalarCoarray]
  ! Error for a STAT variable to be a coindexed object
  !ERROR: Image selector STAT variable must not be a coindexed object
  rVar1 = rCoarray[1,2,3,stat=intCoarray[2,3, 4]]
end subroutine s1