[flang-commits] [flang] [flang] lower ASSOCIATED for procedure pointers (PR #76067)

via flang-commits flang-commits at lists.llvm.org
Wed Dec 20 10:23:08 PST 2023


jeanPerier wrote:

> Thanks for all you work! I was a bit lost when doing it, but anyways. In my local test, I test `associated` with the following code.

Thanks for the review, I thought you had not started on this yet, sorry for not syncing here.

The test that you are pointing at is relying on a non standard behavior, the first `associated(ptr)` is undefined since `ptr` initial status is undefined, in fact if you pass `-O2` to gfortran, it may print false (does for me, but again, this is undefined behavior).

Flang is initializing uninitialized saved and main program pointers to NULL() as an extension for more safety, so flang will consistently print false in your test, but I do not think this is something we should be testing for.

https://github.com/llvm/llvm-project/pull/76067


More information about the flang-commits mailing list