Skip to content
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

Test which tracks default allocatable behaviour #1288

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

pawosm-arm
Copy link
Collaborator

@pawosm-arm pawosm-arm commented Sep 18, 2022

No description provided.

@pawosm-arm pawosm-arm changed the title Additional tests from Kiran and Richard Additional tests from Kiran Sep 18, 2022
@pawosm-arm pawosm-arm changed the title Additional tests from Kiran Test which tracks default allocatable behaviour Sep 18, 2022
@bryanpkc
Copy link
Collaborator

bryanpkc commented Sep 21, 2022

In light of @kiranchandramohan's comment, perhaps we should have another test to make sure that -Mallocatable=95 still works. 😄 There are a number of tests which exercise -Mallocatable=03 but none that uses -Mallocatable=95.

@bryanpkc
Copy link
Collaborator

bryanpkc commented Apr 19, 2023

The test is checking that, with default compiler options, arr is allocated to match the dimensions of the array returned by get_array. In other words, it checks that -Mallocatable=03 (or -frealloc-lhs in GFortran terms) is enabled by default. If the test is compiled with -Mallocatable=95, running the test results in a segmentation fault, at least on my machine.

There are a large number of allocatable-related tests in test/f90_correct/src/al*.f90. I would approve this PR if the test is not already covered in one of the existing tests. It would be nice to rename the test to clarify the intent, e.g. allocatable_assignment.f90.

@pawosm-arm
Copy link
Collaborator Author

The test is checking that, with default compiler options, arr is allocated to match the dimensions of the array returned by get_array. In other words, it checks that -Mallocatable=03 (or -freallocate-lhs in GFortran terms) is enabled by default. If the test is compiled with -Mallocatable=95, running the test results in a segmentation fault, at least on my machine.

There are a large number of allocatable-related tests in test/f90_correct/src/al*.f90. I would approve this PR if the test is not already covered in one of the existing tests. It would be nice to rename the test to clarify the intent, e.g. allocatable_assignment.f90.

Thanks for your comment @bryanpkc. Although there are similar tests, they are not as straight-forward as this one, so it still may have a value. I've renamed it as you'd suggested.

@pawosm-arm pawosm-arm merged commit 7636e7d into flang-compiler:master Apr 20, 2023
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.

3 participants