intel / intel-application-migration-tool-for-openacc-to-openmp

OpenACC* to OpenMP* API assisting migration tool
BSD 3-Clause "New" or "Revised" License
32 stars 5 forks source link

Fixed removal of last char on multiline construct #23

Closed Lyphion closed 1 month ago

Lyphion commented 1 month ago

Fixed wrong removal of last & on multiline construct when reading empty line. The following Fortran code provides an example on how to reproduce the error:

!$ACC DATA &
!$ACC PRESENT(a) &

! Some comment
!$ACC CREATE(b)

When using the code above the internal construct would save data present(a create(b) after parsing, because it would suppress the last char after reading an empty line without checking if the char is really an &.

hservatg commented 1 month ago

@Lyphion -- the proposal looks good. However, the resulting translated code is not accepted by IFX. Not sure if the input (OpenACC) code is legit Fortran, I'm not an expert. Still, I will merge the code -- but I cannot add a test for this specific case as it won't compile.