This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add a semantics test for co_broadcast
ClosedPublic

Authored by rouson on Nov 2 2021, 10:56 PM.

Details

Summary

This patch checks for valid and invalid forms of calls to the collective subroutine co_broadcast.

Diff Detail

Event Timeline

rouson created this revision.Nov 2 2021, 10:56 PM
Herald added a project: Restricted Project. · View Herald Transcript
rouson requested review of this revision.Nov 2 2021, 10:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2021, 10:56 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
rouson updated this revision to Diff 384922.Nov 4 2021, 5:34 PM

Fix procedure name in To Do list comment.

ekieri added a subscriber: ekieri.Nov 18 2021, 8:22 AM

Can you please base the patch on main? This diff looks like a small typo fix, but the whole file is new. That would also help the pre-merge tester to apply your patch.

rouson updated this revision to Diff 388250.Nov 18 2021, 10:05 AM

Rebased off of main and ensured that the whole file appears in the diff.

rouson updated this revision to Diff 391162.Dec 1 2021, 4:23 PM

As suggested in Diff D113086, the updated diff

  1. Removes trailing whitespace if present.
  2. Cites the section of the standard that defines the co_broadcast interface.
  3. Adds a check for an error in which the first co_broadcast argument is coindexed.
rouson updated this revision to Diff 395760.Dec 21 2021, 3:13 PM

This patch makes the co_broadcast test more similar to the other collectives tests by

  1. Adding more types for the 'a' argument,
  2. Varying the type of the 'a' argument's types more frequently throughout the test,
  3. Clarifying the To Do comment,
  4. Replacing several "to be determined" error messages, and
  5. More broadly test argument semantics.
ktras requested changes to this revision.EditedJan 6 2022, 11:05 AM

Similarly to comments I made in my review for D116133, the co_broadcast test could be improved by adding a call which contains optional arguments, but not required arguments. Also, there could be checks added to try and violate the intent-spec of stat and errmsg. There are also some non-standard single quote characters in the expected error messages that should be replaced.

This revision now requires changes to proceed.Jan 6 2022, 11:05 AM
ktras added inline comments.Jan 6 2022, 11:08 AM
flang/test/Semantics/collectives04.f90
44

Trailing comma in argument list should be removed

ktras added inline comments.Jan 6 2022, 11:10 AM
flang/test/Semantics/collectives04.f90
62
66
ktras added a comment.EditedJan 6 2022, 11:26 AM

Please add the source_image argument to any of the non-standard conforming calls where you want to test errors other than the missing source_image argument. If you do this, then the expected error messages you provided will be correct.

rouson updated this revision to Diff 397953.Jan 6 2022, 11:47 AM
rouson marked 3 inline comments as done.
  1. Fixed on typo: removed a trailing comma.
  2. Added check for missing mandatory 'a' argument.
  3. Added test for 'stat' argument intent(out) .
  4. Added check for 'errmsg' argument intent(inout).
  5. Replaced non-standard single-quote characters.

I missed something here: how are single quote characters nonstandard?

ktras added a comment.Jan 6 2022, 12:05 PM

I missed something here: how are single quote characters nonstandard?

The character is nonstandard in the sense that it is not the single quote character that is used in the error messages. So I was suggesting on this differential and on D116133 for @rouson to change the character to ', which he has done.

ktras accepted this revision.Jan 19 2022, 2:56 PM

The updated patch based on feedback looks great! LGTM.

This revision is now accepted and ready to land.Jan 19 2022, 2:56 PM
This revision was automatically updated to reflect the committed changes.