-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[flang][runtime] OPEN(existingUnit,POSITION=) #153688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
eugeneepshteyn
left a comment
There was a problem hiding this 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?
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. |
DanielCChen
left a comment
There was a problem hiding this 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.
DanielCChen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks.
dpalermo
left a comment
There was a problem hiding this 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( |
There was a problem hiding this 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:
- OpenFile at line 201 in unit.h should be OpenFileClass
- PseudoOpenFile::InquirePosition() needs to accept FileOffset as a parameter (unit.h & pseudo-unit.cpp)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, Thanks!
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.