Files
clang-p2996/flang/test/Preprocessing/bug136845.F
Peter Klausler 58535e81dd [flang] Further refinement of OpenMP !$ lines in -E mode (#138956)
Address failing Fujitsu test suite cases that were broken by the patch
to defer the handling of !$ lines in -fopenmp vs. normal compilation to
actual compilation rather than processing them immediately in -E mode.

Tested on the samples in the bug report as well as all of the Fujitsu
tests that I could find that use !$ lines.

Fixes https://github.com/llvm/llvm-project/issues/136845.
2025-05-12 12:16:05 -07:00

46 lines
1.1 KiB
Fortran

!RUN: %flang_fc1 -E %s | FileCheck --check-prefix=PREPRO %s
!RUN: %flang_fc1 -fdebug-unparse %s | FileCheck --check-prefix=NORMAL %s
!RUN: %flang_fc1 -fopenmp -fdebug-unparse %s | FileCheck --check-prefix=OMP %s
c$ !
C$
continue
k=0 w
k=0
c$ 0 x
c$ 1 y
c$ 2 k= z
c$ ! A
c$ !1 B
print *,k
*$1 continue
end
!PREPRO:!$ &
!PREPRO: continue
!PREPRO: k=0
!PREPRO: k=0
!PREPRO:!$
!PREPRO:!$ &
!PREPRO:!$ &k=
!PREPRO:!$ &
!PREPRO:!$ &1
!PREPRO: print *,k
!PREPRO:!$ 1 continue
!PREPRO: end
!NORMAL: k=0_4
!NORMAL: k=0_4
!NORMAL: PRINT *, k
!NORMAL:END PROGRAM
!OMP: CONTINUE
!OMP: k=0_4
!OMP: k=0_4
!OMP: k=1_4
!OMP: PRINT *, k
!OMP: 1 CONTINUE
!OMP:END PROGRAM