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

25 lines
737 B
Fortran

! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --strict-whitespace --check-prefix=CHECK-E
! RUN: %flang_fc1 -fopenmp -fdebug-unparse %s 2>&1 | FileCheck %s --check-prefix=CHECK-OMP
! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
!$ thread = OMP_GET_MAX_THREADS()
!$omp parallel private(ia)
!$ continue
!$omp end parallel
end
!CHECK-E:{{^}}!$ thread = OMP_GET_MAX_THREADS()
!CHECK-E:{{^}}!$omp parallel private(ia)
!CHECK-E:{{^}}!$ continue
!CHECK-E:{{^}}!$omp end parallel
!CHECK-OMP:thread=omp_get_max_threads()
!CHECK-OMP:!$OMP PARALLEL PRIVATE(ia)
!CHECK-OMP: CONTINUE
!CHECK-OMP:!$OMP END PARALLEL
!CHECK-NO-OMP-NOT:thread=
!CHECK-NO-OMP-NOT:!$OMP
!CHECK-NO-OMP:END PROGRAM