[flang] Fix optional assertion in PFTBuilder
authorValentin Clement <clementval@gmail.com>
Wed, 8 Feb 2023 15:54:00 +0000 (16:54 +0100)
committerValentin Clement <clementval@gmail.com>
Wed, 8 Feb 2023 15:54:36 +0000 (16:54 +0100)
commit3f55311a0afff6278571922e1c23bf5c71dd2d0b
tree27035680583f26da15fc74975b9e47aeab139319
parentc83fdc905a655b1354a2b4d3d23f4b7d63e02777
[flang] Fix optional assertion in PFTBuilder

D142279 enabled assertion in libstdc++ and one was triggered
in the PFTBuilder because an optional was access even if it was
null.
This patch fix this issue and add a regression test.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D143589
flang/lib/Lower/PFTBuilder.cpp
flang/test/Lower/pre-fir-tree08.f [new file with mode: 0755]