This is an archive of the discontinued LLVM Phabricator instance.

[flang] Port test_any.sh tests to FileCheck: Hand port tests which use regexes
ClosedPublic

Authored by richard.barton.arm on Jun 19 2020, 2:33 AM.

Details

Summary

The regex syntax used by test_any.sh's FileCheck is sometimes incompatible with
real FileCheck.

Hand port these tests to use FileCheck and it's regex format.

Also remove FIXME from label01 that no longer applies and define a macro
to enable all tests.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript

These (D82164-D82168) all look okay to me but someone who understands FileCheck should approve.

With these changes we can remove test_any.sh, right?

tskeith added a project: Restricted Project.
schweitz added inline comments.Jun 19 2020, 11:37 AM
flang/test/Semantics/label01.F90
2

Should there be two (maybe 3?) RUN: lines? One to test STRICT_F18 and another for ARCHAIC_FORTRAN?

Added new run line for label01 as per schweitz review.

Should there be two (maybe 3?) RUN: lines? One to test STRICT_F18 and another for ARCHAIC_FORTRAN?

Agreed. I have added a line that defines -DSTRICT_F18 and runs with -Mstandard. ARCHAIC_FORTRAN is a superset of the current run line, so I think two run lines should be sufficient.
Note that the test has issues in that it checks for "error:" but the parser diagnostics that are emitted do not start with this. Because of this, the test misses the fact that even without -Mstandard, there is a diagnostic emitted on one of the testcases.
I propose the fix for this test is a separate change.

With these changes we can remove test_any.sh, right?

Agreed. I thought about pushing these in a sequence as one would with a github PR, but figured as they did not actually depend on eachother I would submit them as separate phab reviews. I propose to edit the last commit that gets approved with a git rm on that file.

Note that the test has issues in that it checks for "error:" but the parser diagnostics that are emitted do not start with this. Because of this, the test misses the fact that even without -Mstandard, there is a diagnostic emitted on one of the testcases.
I propose the fix for this test is a separate change.

Sounds good. Hopefully the flang driver will be written to support a -verify-diagnostics mode.

I can't see why the pre-commit checks are failing. As they are Beta I propose to ignore them.

richard.barton.arm added a comment.EditedJun 26 2020, 7:55 AM

Ping. @schweitz are you happy to approve?

Also D82165, D82166, D82167 and D82168.

schweitz accepted this revision.Jun 26 2020, 8:51 AM
This revision is now accepted and ready to land.Jun 26 2020, 8:51 AM
This revision was automatically updated to reflect the committed changes.