This is an archive of the discontinued LLVM Phabricator instance.

Test conforming & non-conforming lcobound intrinsic function semantics
ClosedPublic

Authored by rouson on Apr 13 2022, 5:14 PM.

Details

Summary

Add a test with standard-conforming non-conforming lcobound() intrinsic function invocations. Also test that several non-conforming lcobound() invocations generate the correct error messages.

Diff Detail

Event Timeline

rouson created this revision.Apr 13 2022, 5:14 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: jdoerfert. · View Herald Transcript
rouson requested review of this revision.Apr 13 2022, 5:14 PM
ktras requested changes to this revision.EditedApr 14 2022, 9:43 AM

Since lcobound is not yet implemented, please remove the TBD error messages and add the one error message I mention in the code, so that the test can pass until it is implemented. Thanks.

flang/test/Semantics/lcobound.f90
13

Please add !ERROR: No explicit type declared for 'lcobound' before line 12.

This revision now requires changes to proceed.Apr 14 2022, 9:43 AM
rouson updated this revision to Diff 422905.Apr 14 2022, 10:22 AM

Remove unimplemented "!ERROR: ..." directives.

rouson marked an inline comment as done.Apr 14 2022, 10:23 AM
ktras requested changes to this revision.May 2 2022, 1:43 PM

The test looks great and tests a lot of different ways to violate the standard, but I have one suggestion. I would recommend adding a call to lcobound where a non-constant integer is passed to the kind argument, as the standard requires that it shall be a scalar integer constant expression.

This revision now requires changes to proceed.May 2 2022, 1:43 PM
ktras added a comment.May 9 2022, 12:45 PM

Additionally, in the section of this test that sets out to have only calls that are standard-conforming, please make sure that the result of the calls are being assigned to a variable that is a scalar if the dim argument is present, and are being assigned to a variable that is an array if the dim argument in not present.

rouson updated this revision to Diff 428816.May 11 2022, 4:46 PM
  • Fixed left-hand-side of assignments where array is required because dim argument is not present.
  • Test requirement that the kind parameters be an integer constant.
  • Test violation of rank requirement for dim argument.
ktras accepted this revision.May 17 2022, 9:40 AM

LGTM!

This revision is now accepted and ready to land.May 17 2022, 9:40 AM
rouson closed this revision.May 18 2022, 4:59 PM

pushed to main