llvm-project/flang/test/Preprocessing/line-in-contin.F90
Peter Klausler f099f76bb2
[flang] Handle pp-directives better in line continuation (#105572)
The code for detecting and processing some preprocessing directives
(conditional compilation and #line) while skipping comments between one
source or compiler directive line and its continuations wasn't correctly
handling the case of such a directive following an explicit ampersand.

Fixes https://github.com/llvm/llvm-project/issues/100730 and
https://github.com/llvm/llvm-project/issues/100345.
2024-08-26 10:51:24 -07:00

35 lines
573 B
Fortran

! RUN: %flang_fc1 -fopenmp -E %s 2>&1 | FileCheck %s
! CHECK: call foo(0.)
! CHECK: call foo(1.)
! CHECK: call foo(2.)
! CHECK: call foo(3.)
! CHECK: !$omp parallel do default(none) private(j)
! CHECK: !$omp end parallel do
call foo( &
# 100 "bar.h"
& 0.)
call foo( &
# 101 "bar.h"
1.)
call foo( &
# 102 "bar.h"
& 2. &
& )
call foo( &
# 103 "bar.h"
& 3. &
)
!$omp parallel do &
#ifdef undef
!$omp garbage &
#else
!$omp default(none) &
#endif
!$omp private(j)
do j=1,100
end do
!$omp end &
# 104 "bar.h"
!$omp parallel do
end