[flang][hlfir] Fixed passing c_ptr arguments by value.
authorSlava Zakharin <szakharin@nvidia.com>
Wed, 26 Apr 2023 23:24:10 +0000 (16:24 -0700)
committerSlava Zakharin <szakharin@nvidia.com>
Thu, 27 Apr 2023 18:54:33 +0000 (11:54 -0700)
commit882e5f7bb7a4c7dd926abcf68eddb97d795c4241
treec7ca92e100ebf176eb7e2ad7ce4bc1e6167de2db
parentd8e9dd33b2a5546af0b26243810712629d4d5f14
[flang][hlfir] Fixed passing c_ptr arguments by value.

c_ptr arguments passed by value need special handling, which was missing
in HLFIR lowering. The lowering has to load the __address component
and pass the loaded value as the actual argument.

Differential Revision: https://reviews.llvm.org/D149307
flang/lib/Lower/ConvertCall.cpp
flang/test/HLFIR/c_ptr_byvalue.f90 [new file with mode: 0644]