Skip to content

Conversation

@klausler
Copy link
Contributor

Ensure that when a connected unit is reopened with POSITION='REWIND' or 'APPEND', and a STATUS='OLD' or unspecified, that it is actually repositioned as requested.

Fixes #153426.

Copy link
Contributor

@eugeneepshteyn eugeneepshteyn left a comment

Choose a reason for hiding this comment

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

LGTM. Any tests possible?

@klausler
Copy link
Contributor Author

LGTM. Any tests possible?

Best left to end-to-end Fortran testing, which isn't really possible in llvm-project. Maybe @DanielCChen has plans to contribute these tests to llvm-test-suite?

@DanielCChen
Copy link
Contributor

LGTM. Any tests possible?

Best left to end-to-end Fortran testing, which isn't really possible in llvm-project. Maybe @DanielCChen has plans to contribute these tests to llvm-test-suite?

Right. We are planning to put all these tests into llvm-test-suite.

Copy link
Contributor

@DanielCChen DanielCChen left a comment

Choose a reason for hiding this comment

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

Please see my comment in the issue.

Ensure that when a connected unit is reopened with POSITION='REWIND'
or 'APPEND', and a STATUS='OLD' or unspecified, that it is actually
repositioned as requested.

Fixes llvm#153426.
Copy link
Contributor

@DanielCChen DanielCChen left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks.

@klausler klausler merged commit c53792b into llvm:main Aug 18, 2025
9 checks passed
@klausler klausler deleted the bug153426 branch August 18, 2025 21:44
Copy link
Contributor

@dpalermo dpalermo left a comment

Choose a reason for hiding this comment

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

The hostdevice build of flang-rt fails after this change with "error: call to non-static member function without an object argument"
This can be fixed by making a couple small changes (see unit.h inline comments)

RT_API_ATTRS int GetAsynchronousId(IoErrorHandler &);
RT_API_ATTRS bool Wait(int);
RT_API_ATTRS Position InquirePosition() const {
return OpenFile::InquirePosition(
Copy link
Contributor

Choose a reason for hiding this comment

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

The hostdevice build of flang-rt fails after this change with "error: call to non-static member function without an object argument"
This can be fixed by making a couple small changes:

  • OpenFile at line 201 in unit.h should be OpenFileClass
  • PseudoOpenFile::InquirePosition() needs to accept FileOffset as a parameter (unit.h & pseudo-unit.cpp)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix was in #154357, merged an hour ago.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great, Thanks!

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.

[flang] INQUIRE statement returns incorrect POSITION=

4 participants