File: image_index02.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 (109 lines) | stat: -rw-r--r-- 4,532 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
! RUN: %python %S/test_errors.py %s %flang_fc1
! Check for semantic errors in image_index() function references
! based on the 16.9.107 section of the Fortran 2023 standard

program image_index_test
  use iso_c_binding, only: c_int32_t
  use iso_fortran_env, only: team_type
  implicit none

  integer n, array(1), non_coarray, scalar, team_num
  integer scalar_coarray[*], array_coarray(1)[*], coarray_corank3[10, 0:9, 0:*], repeated_coarray[*]
  integer subscripts_corank1(1), subscripts_corank3(3), repeated_sub(1), multi_rank_array(3,3)
  integer, parameter :: const_subscripts_corank1(1) = [1]
  logical non_integer_array(1)
  type(team_type) :: home, league(2), wrong_result_type

  !___ non-conforming statements ___

  !ERROR: missing mandatory 'coarray=' argument
  n = image_index()

  !ERROR: missing mandatory 'sub=' argument
  n = image_index(scalar_coarray)

  !ERROR: 'sub=' argument has unacceptable rank 2
  n = image_index(scalar_coarray, multi_rank_array)

  !ERROR: The size of 'SUB=' (1) for intrinsic 'image_index' must be equal to the corank of 'COARRAY=' (3)
  n = image_index(coarray_corank3, subscripts_corank1, league(1))

  !ERROR: The size of 'SUB=' (1) for intrinsic 'image_index' must be equal to the corank of 'COARRAY=' (3)
  n = image_index(coarray_corank3, const_subscripts_corank1, league(1))

  !ERROR: The size of 'SUB=' (1) for intrinsic 'image_index' must be equal to the corank of 'COARRAY=' (3)
  n = image_index(coarray_corank3, [1], league(1))

  !ERROR: The size of 'SUB=' (6) for intrinsic 'image_index' must be equal to the corank of 'COARRAY=' (3)
  n = image_index(coarray_corank3, [1,2,3,4,5,6])

  !ERROR: missing mandatory 'coarray=' argument
  n = image_index(sub=[1])

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(team=home)

  !ERROR: 'coarray=' argument must have corank > 0 for intrinsic 'image_index'
  n = image_index(non_coarray, [1])

  !ERROR: Actual argument for 'sub=' has bad type 'LOGICAL(4)'
  n = image_index(array_coarray, [.true.])

  !ERROR: Actual argument for 'sub=' has bad type 'LOGICAL(4)'
  n = image_index(array_coarray, non_integer_array)

  !ERROR: 'sub=' argument has unacceptable rank 0
  n = image_index(array_coarray, scalar)

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(scalar_coarray, subscripts_corank1, team=league)

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(scalar_coarray, [1], team=team_num)

  !ERROR: too many actual arguments for intrinsic 'image_index'
  n = image_index(array_coarray, [1], home, team_num)

  !ERROR: too many actual arguments for intrinsic 'image_index'
  n = image_index(array_coarray, [1], home, team_num)

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(array_coarray, [1], team=home, team=league(1))

  !ERROR: repeated keyword argument to intrinsic 'image_index'
  n = image_index(coarray=scalar_coarray, sub=[1], coarray=repeated_coarray)

  !ERROR: keyword argument to intrinsic 'image_index' was supplied positionally by an earlier actual argument
  n = image_index(scalar_coarray, [1], coarray=repeated_coarray)

  !ERROR: repeated keyword argument to intrinsic 'image_index'
  n = image_index(scalar_coarray, sub=subscripts_corank1, sub=repeated_sub)

  !ERROR: keyword argument to intrinsic 'image_index' was supplied positionally by an earlier actual argument
  n = image_index(scalar_coarray, subscripts_corank1, sub=repeated_sub)

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(scalar_coarray, [1], team_number=array)

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(scalar_coarray, [1], team_number=home)

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(array_coarray, [1], team=home, team_number=team_num)

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(c=scalar_coarray, [1])

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(scalar_coarray, subscripts=[1])

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(scalar_coarray, [1], team_num=team_num)

  !ERROR: unknown keyword argument to intrinsic 'image_index'
  n = image_index(scalar_coarray, [1], teams=home)

  !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types TYPE(team_type) and INTEGER(4)
  wrong_result_type = image_index(scalar_coarray, subscripts_corank1)

end program image_index_test