Files
clang-p2996/flang/test/Preprocessing/pp132.f90
Peter Klausler 5942f0269e [flang] Preserve compiler directives in -E output (#133959)
No longer require -fopenmp or -fopenacc with -E, unless specific version
number options are also required for predefined macros. This means that
most source can be preprocessed with -E and then later compiled with
-fopenmp, -fopenacc, or neither.

This means that OpenMP conditional compilation lines (!$) are also
passed through to -E output. The tricky part of this patch was dealing
with the fact that those conditional lines can also contain regular
Fortran line continuation, and that now has to be deferred when !$ lines
are interspersed.
2025-04-04 09:49:57 -07:00

24 lines
1.0 KiB
Fortran

! RUN: %flang -E %s 2>&1 | FileCheck --strict-whitespace %s
! CHECK: {{^}}!$OMP parallel default(shared) private(super_very_long_name_for_the_va&
! CHECK-NEXT: {{^}}!$OMP&riable)
! CHECK: {{^}}!$omp end parallel
! CHECK: {{^}}!$acc data copyin(super_very_long_name_for_the_variable, another_super&
! CHECK-NEXT: {{^}}!$acc&_wordy_variable_to_test)
! CHECK: {{^}}!$acc end data
! CHECK: {{^}}!$OMP something something
! Test correct continuations in compiler directives and left-alignment of sentinels
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
!$OMP something something
end subroutine foo