llvm-project/flang/test/Preprocessing/omp-sentinel-fixed-form.F
Tom Eccles c2e41be50f
[flang][Parser] Add whitespace token after the sentinel in fixed form (#148825)
Fixes #148386

The first time the line was classified (using
`Prescanner::ClassifyLine(const char *)`) the line was correctly
classified as a compiler directive. But then later on the token form is
invoked (`Prescanner::ClassifyLine(TokenSequence, Provenance)`). This
one incorrectly classified the line as a comment because there was no
whitespace token right after the sentinel. This fixes the issue by
ensuring this whitespace is added.
2025-07-15 16:39:34 +01:00

22 lines
640 B
Fortran

! RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=50 %s | FileCheck %s
#define OMP_TARGET .true.
#define OMP_SIMD .false.
program test
implicit none
integer i,j,n
n = 100
! CHECK: !$OMP METADIRECTIVE WHEN(USER={CONDITION(.true._4)}: TARGET TEAMS DISTRIBUTE PARALLEL&
! CHECK: !$OMP& DO) DEFAULT(TARGET TEAMS LOOP)
!$omp metadirective
!$omp& when(user={condition(OMP_TARGET.or.OMP_SIMD)}:
!$omp& target teams distribute parallel do )
!$omp& default(target teams loop)
do i=0,n
do j=0,n
write(*,*) "Test"
enddo
enddo
return
end program