Add a test with a range of this_image() intrinsic function
invocations, including a comprehensive set of standard-conforming
keyword and non-keyword arguments with and without optional
arguments present and with argument positions covering all
possible orderings. Also test that several non-conforming
this_image() invocations generate the correct error messages.
Details
Diff Detail
Event Timeline
I have only one small suggestion, please see the suggested code edit.
flang/test/Semantics/this_image02.f90 | ||
---|---|---|
84 | Since team is an optional argument, I would recommend using the keyword argument here to explicitly test whether the team argument is being restricted to a scalar of team_type or not. |
flang/test/Semantics/this_image02.f90 | ||
---|---|---|
31 | The implementation of this_image does not currently support this call, so please add the following error message before it. |
flang/test/Semantics/this_image02.f90 | ||
---|---|---|
31 | Don't change tests to match buggy behavior. |
flang/test/Semantics/this_image02.f90 | ||
---|---|---|
31 | I believe that @rouson is working on contributing tests for parallel features but is not currently looking at editing source. It seems to me in this situation there are three options:
Based on looking at other tests in the past that had error directives that would go away once certain features were supported, I thought this case was similar and thought the last option was best. @klausler Since your comment seems to say this is not the best approach, which is the best option for this test and what matches the workflow of the developers? |
flang/test/Semantics/this_image02.f90 | ||
---|---|---|
31 | Probably the first option, if the bug can't be fixed. But fixing the bug would be best. |
Add XFAIL directive and responding to one review comment by adding a keyword argument.
The test is looking great, but I have recognized a couple more changes I would suggest. Please see the inline comments. I would also recommend adding a non-standard conforming call where a constant, either a named constant or a literal constant, is being passed to the dim argument and where its value is out of bounds of the corank of the coarray argument.
flang/test/Semantics/this_image02.f90 | ||
---|---|---|
24 | When the coarray argument is present, but the dim argument is not present, the result will be an array of rank one, so this could be moved to the non-standard conforming section of the test and it could be replaced with a call where the result is assigned to an array. | |
25 | Similar to the comments on the line above, to keep this in the standards conforming section of your test, please replace the variable that the result of the call is being assigned to with an array. |
This update fixes the standard-conforming this_image() invocations in which the optional dim argument is not present.
When the coarray argument is present, but the dim argument is not present, the result will be an array of rank one, so this could be moved to the non-standard conforming section of the test and it could be replaced with a call where the result is assigned to an array.