Skip to content

[flang] Tests for rank-1 integer array bounds in explicit shape arrays#411

Open
ivanrodriguez3753 wants to merge 1 commit into
llvm:mainfrom
ivanrodriguez3753:int_array_explicit_shape
Open

[flang] Tests for rank-1 integer array bounds in explicit shape arrays#411
ivanrodriguez3753 wants to merge 1 commit into
llvm:mainfrom
ivanrodriguez3753:int_array_explicit_shape

Conversation

@ivanrodriguez3753

Copy link
Copy Markdown

No description provided.

@tarunprabhu tarunprabhu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have requested reviews from folks who are more familiar with F2023 features.

Comment thread Fortran/cray/f2023/08/05/CMakeLists.txt Outdated
Comment on lines +1 to +5
# Exclude tests that require unimplemented feature (conditional expression as
# actual argument)
file(GLOB _sources *.f90)

set(Source ${_sources})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what this is doing.

@ivanrodriguez3753

Copy link
Copy Markdown
Author

@akuhlens @eugeneepshteyn

@kwyatt-ext

Copy link
Copy Markdown
Contributor

I will review this soon. It is in my queue.

@kwyatt-ext kwyatt-ext left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a very well written test. 2 things to note:

  1. Recommended case addition.
  2. I didn't check but make sure code is merged before merging this.

! 10. Implied-do + array slices + arithmetic in bounds
! 11. Vector subscripts in bounds expressions
! 12. Block construct re-evaluation — bounds from enclosing scope

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend adding a case with a UB < LB. It should produce a valid array of 0 size, but could happen in dynamic code.

@cenewcombe cenewcombe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left an inline comment for you to consider. I don't need to re-review, looks good!

! 9. Element write/read correctness
! 10. Implied-do + array slices + arithmetic in bounds
! 11. Vector subscripts in bounds expressions
! 12. Block construct re-evaluation — bounds from enclosing scope

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more edge cases for your consideration:

  • negative bounds
  • modify/clobber the bounds variable within the same scope (verify that bounds do not change)
  • declare a constant (PARAMETER) bounds array -- exercises the compile-time constant-folding path vs. the runtime extraction path

This comment is meant to be non-blocking. The test coverage is very good. It would also be reasonable to implement some of these checks as lit tests rather than in the test suite (or they may already be covered in lit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants