Files
clang-p2996/flang/test/Preprocessing/pp132.f90
Daniil Dudkin 889c7c8e92 [flang] Support correct continuations for compiler directives
If a line is over 72 characters long, flang's preprocessor cuts it there
and continues on the next line.
For this purpose it uses the standard way of continuing line with & on each line.
However, it doesn't work with long compiler directives, like OpenMP or OpenACC ones.
The line that continues the directive also has to
contain the corresponding sentinel at the beginning.

This change implements the described functionality.
Also, some code was refactored in order to simplify and reuse existing code.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D126301
2022-05-27 13:45:37 +03:00

19 lines
820 B
Fortran

! RUN: %flang -E -fopenmp -fopenacc %s 2>&1 | FileCheck %s
! CHECK: !$OMP parallel default(shared) private(super_very_long_name_for_the_va&
! CHECK: !$OMP&riable)
! CHECK: !$acc data copyin(super_very_long_name_for_the_variable, another_super&
! CHECK: !$acc&_wordy_variable_to_test)
! Test correct continuations in compiler directives
subroutine foo
integer :: super_very_long_name_for_the_variable
integer :: another_super_wordy_variable_to_test
super_very_long_name_for_the_variable = 42
another_super_wordy_variable_to_test = super_very_long_name_for_the_variable * 2
!$OMP parallel default(shared) private(super_very_long_name_for_the_variable)
!$omp end parallel
!$acc data copyin(super_very_long_name_for_the_variable, another_super_wordy_variable_to_test)
!$acc end data
end subroutine foo