|
1 | 1 | ! RUN: %python %S/test_errors.py %s %flang_fc1
|
2 |
| -! XFAIL: * |
3 | 2 | ! This test checks for semantic errors in co_reduce subroutine calls based on
|
4 | 3 | ! the co_reduce interface defined in section 16.9.49 of the Fortran 2018 standard.
|
5 | 4 | ! To Do: add co_reduce to the list of intrinsics
|
@@ -63,119 +62,122 @@ program main
|
63 | 62 | ! executing in multiple images is not.
|
64 | 63 |
|
65 | 64 | ! argument 'a' cannot be polymorphic
|
66 |
| - !ERROR: to be determined |
| 65 | + !ERROR: No explicit type declared for 'derived_type_op' |
67 | 66 | call co_reduce(polymorphic, derived_type_op)
|
68 | 67 |
|
69 | 68 | ! argument 'a' cannot be coindexed
|
70 |
| - !ERROR: (message to be determined) |
| 69 | + !ERROR: 'a' argument to 'co_reduce' may not be a coindexed object |
71 | 70 | call co_reduce(coindexed[1], int_op)
|
72 | 71 |
|
73 | 72 | ! argument 'a' is intent(inout)
|
74 |
| - !ERROR: (message to be determined) |
| 73 | + !ERROR: Actual argument associated with INTENT(IN OUT) dummy argument 'a=' is not definable |
| 74 | + !ERROR: 'i+1_4' is not a variable or pointer |
75 | 75 | call co_reduce(i + 1, int_op)
|
76 | 76 |
|
77 | 77 | ! operation must be a pure function
|
78 |
| - !ERROR: (message to be determined) |
| 78 | + !ERROR: OPERATION= argument of CO_REDUCE() must be a pure function of two data arguments |
79 | 79 | call co_reduce(i, operation=not_pure)
|
80 | 80 |
|
81 | 81 | ! operation must have exactly two arguments
|
82 |
| - !ERROR: (message to be determined) |
| 82 | + !ERROR: OPERATION= argument of CO_REDUCE() must be a pure function of two data arguments |
83 | 83 | call co_reduce(i, too_many_args)
|
84 | 84 |
|
85 | 85 | ! operation result must be a scalar
|
86 |
| - !ERROR: (message to be determined) |
| 86 | + !ERROR: OPERATION= argument of CO_REDUCE() must be a scalar function |
87 | 87 | call co_reduce(i, array_result)
|
88 | 88 |
|
89 | 89 | ! operation result must be non-allocatable
|
90 |
| - !ERROR: (message to be determined) |
| 90 | + !ERROR: Result of OPERATION= procedure of CO_REDUCE() must be scalar and neither allocatable, pointer, nor polymorphic |
91 | 91 | call co_reduce(i, allocatable_result)
|
92 | 92 |
|
93 | 93 | ! operation result must be non-pointer
|
94 |
| - !ERROR: (message to be determined) |
| 94 | + !ERROR: Result of OPERATION= procedure of CO_REDUCE() must be scalar and neither allocatable, pointer, nor polymorphic |
95 | 95 | call co_reduce(i, pointer_result)
|
96 | 96 |
|
97 | 97 | ! operation's arguments must be scalars
|
98 |
| - !ERROR: (message to be determined) |
| 98 | + !ERROR: Arguments of OPERATION= procedure of CO_REDUCE() must be both scalar of the same type as A=, and neither allocatable, pointer, polymorphic, nor optional |
99 | 99 | call co_reduce(i, array_args)
|
100 | 100 |
|
101 | 101 | ! operation arguments must be non-allocatable
|
102 |
| - !ERROR: (message to be determined) |
| 102 | + !ERROR: Arguments of OPERATION= procedure of CO_REDUCE() must be both scalar of the same type as A=, and neither allocatable, pointer, polymorphic, nor optional |
103 | 103 | call co_reduce(i, allocatable_args)
|
104 | 104 |
|
105 | 105 | ! operation arguments must be non-pointer
|
106 |
| - !ERROR: (message to be determined) |
| 106 | + !ERROR: Arguments of OPERATION= procedure of CO_REDUCE() must be both scalar of the same type as A=, and neither allocatable, pointer, polymorphic, nor optional |
107 | 107 | call co_reduce(i, pointer_args)
|
108 | 108 |
|
109 | 109 | ! operation arguments must be non-polymorphic
|
110 |
| - !ERROR: (message to be determined) |
| 110 | + !ERROR: OPERATION= argument of CO_REDUCE() must have the same type as A= |
111 | 111 | call co_reduce(i, polymorphic_args)
|
112 | 112 |
|
113 | 113 | ! operation: type of 'operation' result and arguments must match type of argument 'a'
|
114 |
| - !ERROR: (message to be determined) |
| 114 | + !ERROR: OPERATION= argument of CO_REDUCE() must have the same type as A= |
115 | 115 | call co_reduce(i, real_op)
|
116 | 116 |
|
117 | 117 | ! operation: kind type parameter of 'operation' result and arguments must match kind type parameter of argument 'a'
|
118 |
| - !ERROR: (message to be determined) |
| 118 | + !ERROR: OPERATION= argument of CO_REDUCE() must have the same type as A= |
119 | 119 | call co_reduce(x, double_precision_op)
|
120 | 120 |
|
121 | 121 | ! arguments must be non-optional
|
122 |
| - !ERROR: (message to be determined) |
| 122 | + !ERROR: Arguments of OPERATION= procedure of CO_REDUCE() must be both scalar of the same type as A=, and neither allocatable, pointer, polymorphic, nor optional |
123 | 123 | call co_reduce(i, optional_args)
|
124 | 124 |
|
125 | 125 | ! if one argument is asynchronous, the other must be also
|
126 |
| - !ERROR: (message to be determined) |
| 126 | + !ERROR: If either argument of the OPERATION= procedure of CO_REDUCE() has the ASYNCHRONOUS, TARGET, or VALUE attribute, both must have that attribute |
127 | 127 | call co_reduce(i, asynchronous_mismatch)
|
128 | 128 |
|
129 | 129 | ! if one argument is a target, the other must be also
|
130 |
| - !ERROR: (message to be determined) |
| 130 | + !ERROR: If either argument of the OPERATION= procedure of CO_REDUCE() has the ASYNCHRONOUS, TARGET, or VALUE attribute, both must have that attribute |
131 | 131 | call co_reduce(i, target_mismatch)
|
132 | 132 |
|
133 | 133 | ! if one argument has the value attribute, the other must have it also
|
134 |
| - !ERROR: (message to be determined) |
| 134 | + !ERROR: If either argument of the OPERATION= procedure of CO_REDUCE() has the ASYNCHRONOUS, TARGET, or VALUE attribute, both must have that attribute |
135 | 135 | call co_reduce(i, value_mismatch)
|
136 | 136 |
|
137 | 137 | ! result_image argument must be an integer scalar
|
138 |
| - !ERROR: to be determined |
| 138 | + !ERROR: 'result_image=' argument has unacceptable rank 1 |
139 | 139 | call co_reduce(i, int_op, result_image=integer_array)
|
140 | 140 |
|
141 | 141 | ! result_image argument must be an integer
|
142 |
| - !ERROR: to be determined |
| 142 | + !ERROR: Actual argument for 'result_image=' has bad type 'LOGICAL(4)' |
143 | 143 | call co_reduce(i, int_op, result_image=bool)
|
144 | 144 |
|
145 | 145 | ! stat not allowed to be coindexed
|
146 |
| - !ERROR: to be determined |
| 146 | + !ERROR: 'errmsg' argument to 'co_reduce' may not be a coindexed object |
147 | 147 | call co_reduce(i, int_op, stat=coindexed[1])
|
148 | 148 |
|
149 | 149 | ! stat argument must be an integer scalar
|
150 |
| - !ERROR: to be determined |
| 150 | + !ERROR: 'stat=' argument has unacceptable rank 1 |
151 | 151 | call co_reduce(i, int_op, result_image=1, stat=integer_array)
|
152 | 152 |
|
153 | 153 | ! stat argument has incorrect type
|
154 | 154 | !ERROR: Actual argument for 'stat=' has bad type 'CHARACTER(KIND=1,LEN=1_8)'
|
155 |
| - call co_reduce(i, int_op, result_image=1, string) |
| 155 | + call co_reduce(i, int_op, result_image=1, stat=string) |
156 | 156 |
|
157 | 157 | ! stat argument is intent(out)
|
158 |
| - !ERROR: to be determined |
| 158 | + !ERROR: Actual argument associated with INTENT(OUT) dummy argument 'stat=' is not definable |
| 159 | + !ERROR: '2_4' is not a variable or pointer |
159 | 160 | call co_reduce(i, int_op, result_image=1, stat=1+1)
|
160 | 161 |
|
161 | 162 | ! errmsg argument must not be coindexed
|
162 |
| - !ERROR: to be determined |
| 163 | + !ERROR: No explicit type declared for 'conindexed_string' |
163 | 164 | call co_reduce(i, int_op, result_image=1, stat=status, errmsg=conindexed_string[1])
|
164 | 165 |
|
165 | 166 | ! errmsg argument must be a character scalar
|
166 |
| - !ERROR: to be determined |
| 167 | + !ERROR: 'errmsg=' argument has unacceptable rank 1 |
167 | 168 | call co_reduce(i, int_op, result_image=1, stat=status, errmsg=character_array)
|
168 | 169 |
|
169 | 170 | ! errmsg argument must be a character
|
170 |
| - !ERROR: to be determined |
| 171 | + !ERROR: Actual argument for 'errmsg=' has bad type 'INTEGER(4)' |
171 | 172 | call co_reduce(i, int_op, result_image=1, stat=status, errmsg=i)
|
172 | 173 |
|
173 | 174 | ! errmsg argument is intent(inout)
|
174 |
| - !ERROR: to be determined |
| 175 | + !ERROR: Actual argument associated with INTENT(IN OUT) dummy argument 'errmsg=' is not definable |
| 176 | + !ERROR: '"literal constant"' is not a variable or pointer |
175 | 177 | call co_reduce(i, int_op, result_image=1, stat=status, errmsg="literal constant")
|
176 | 178 |
|
177 | 179 | ! too many arguments to the co_reduce() call
|
178 |
| - !ERROR: too many actual arguments for intrinsic 'co_reduce' |
| 180 | + !ERROR: actual argument #6 without a keyword may not follow an actual argument with a keyword |
179 | 181 | call co_reduce(i, int_op, result_image=1, stat=status, errmsg=message, 3.4)
|
180 | 182 |
|
181 | 183 | ! non-existent keyword argument
|
|
0 commit comments