Skip to content

[Fortran/gfortran] Add a simple not tool to the test suite #60

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

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

tarunprabhu
Copy link
Contributor

Add a tool very similar to LLVM's not utility which inverts the return code of a command. The major difference is that the utility is not dependent on LLVM's libraries and performs less error checking than LLVM's not. It does support the
--crash option when the command is expected to crash.

There is a need for something similar to the not utility in the gfortran test suite where some tests are expected to crash. However, we cannot rely on the utility being available since the LLVM build directory may not be available when running the test suite. Unless LLVM was built with -DLLVM_INSTALL_UTILS=On, the utilities will not be available even if clang/flang are present.

In keeping with some of the other tools in the test suite which were borrowed from LLVM, this has been stripped down and made independent of LLVM's libraries.

@cabreraam
Copy link
Contributor

Thanks for working on this! I'll have a look next week.

@tblah tblah requested a review from yiwu0b11 December 11, 2023 19:19
Copy link
Contributor

@tblah tblah 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!

Copy link
Contributor

@cabreraam cabreraam left a comment

Choose a reason for hiding this comment

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

I can't speak to any of the Windows stuff, but it mostly LGTM! I just had one question about how you invoke std::system.

Copy link
Contributor

@cabreraam cabreraam left a comment

Choose a reason for hiding this comment

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

I will defer to @yi-wu-arm

Otherwise, LGTM

Copy link
Contributor

@yiwu0b11 yiwu0b11 left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all my comment! I may have over-complicate this stuff.

Add a tool similar to LLVM's not utility which inverts the return code of a
command. The major difference is that the utility is not dependent on LLVM's
libraries and performs less error checking than LLVM's not. It supports the
 --crash option when the command is expected to crash.

The tests in Fortran/gfortran have been updated to use this.
@tarunprabhu tarunprabhu merged commit 35d97bd into llvm:main Dec 18, 2023
@tarunprabhu tarunprabhu deleted the import-llvm-not branch May 14, 2025 22:39
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.

4 participants