flang
flang copied to clipboard
Test which tracks default allocatable behaviour
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.
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.
The test is checking that, with default compiler options,
arris allocated to match the dimensions of the array returned byget_array. In other words, it checks that-Mallocatable=03(or-freallocate-lhsin 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 intest/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.