Page MenuHomePhabricator

[flang] Add a semantics test for co_min
ClosedPublic

Authored by rouson on Nov 2 2021, 7:26 PM.

Details

Summary

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

Diff Detail

Event Timeline

rouson created this revision.Nov 2 2021, 7:26 PM
Herald added a project: Restricted Project. · View Herald Transcript
rouson requested review of this revision.Nov 2 2021, 7:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2021, 7:26 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript

I'm guessing that this won't pass "git clang-format" (although I don't know if test files are checked. I'll check and let you know offline.

I couldn’t get "git clang-format" to work on my system after installing it with homebrew. Any advice on how using clang-format is welcome.

PeteSteinfeld added a subscriber: PeteSteinfeld.EditedNov 3 2021, 11:40 AM

I couldn’t get "git clang-format" to work on my system after installing it with homebrew. Any advice on how using clang-format is welcome.

I just build clang. One of the executables that gets built is clang-format. I don't use git clang-format. Note that the official version of clang-format is from release 12.

ktras added a comment.EditedNov 3 2021, 11:59 AM

Does git clang-format make any changes to fortran code? Or just c/c++ code?

Does git clang-format make any changes to fortran code? Or just c/c++ code?

It's specific to C/C++. But I usually run it on both the source code and on any tests written in C/C++ (like some of the runtime tests).

ktras added a comment.Nov 3 2021, 12:23 PM

Does git clang-format make any changes to fortran code? Or just c/c++ code?

It's specific to C/C++. But I usually run it on both the source code and on any tests written in C/C++ (like some of the runtime tests).

I see, that makes sense. Since Damian's test is in Fortran, the tool won't make any changes then. Does that mean that the style and formatting of code in Fortran tests in llvm-project does not have to match any particular style or formatting?

Does git clang-format make any changes to fortran code? Or just c/c++ code?

It's specific to C/C++. But I usually run it on both the source code and on any tests written in C/C++ (like some of the runtime tests).

I see, that makes sense. Since Damian's test is in Fortran, the tool won't make any changes then. Does that mean that the style and formatting of code in Fortran tests in llvm-project does not have to match any particular style or formatting?

I personally would much prefer that it matches existing tests. But, as far as I know, there are no automated tools that will flag Fortran formatting inconsistencies.

I personally would much prefer that it matches existing tests. But, as far as I know, there are no automated tools that will flag Fortran formatting inconsistencies.

I completely disagree. The more variations of style that the tests can present to parsing and semantics, the more test coverage we get.

rouson updated this revision to Diff 384921.Nov 4 2021, 5:30 PM
  1. Add co_min test to expectedly failed list.
  2. Replaced non-ASCII characters.
  3. Correct expected error message.
  4. Update run directive to use test_errors.py.
ktras accepted this revision.Nov 17 2021, 3:02 PM

LGTM

This revision is now accepted and ready to land.Nov 17 2021, 3:02 PM
rouson updated this revision to Diff 391150.Dec 1 2021, 3:24 PM
rouson updated this revision to Diff 394966.Dec 16 2021, 12:53 PM
  1. Expand the coverage of argument types to include characters.
  2. Vary the types of argument 'a' more throughout the test.
  3. Group like calls into blocks with a leading comment describing the block.
rouson updated this revision to Diff 395012.Dec 16 2021, 3:05 PM

Update co_min test to be uniform with co_max test:

  1. Expand types tested for argument 'a'.
  2. Vary the types tested more throughout the test.
  3. Replace several "to be determined" error messages.
  4. Fix typo: remove extraneous comma.
  5. Clarify the "To Do" comment.
ktras accepted this revision.Dec 20 2021, 10:56 AM

Latest diff improves the breadth of the test. LGTM.

This revision was automatically updated to reflect the committed changes.