forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLANG][OPENMP] Fix handling of continuation lines in mixed OpenMP an… (
llvm#120714) …d Fortran free-form OpenMP feature was not enabled in the flang-new for the continuation line, when we used the continuation line marker in combination of free-form and OpenMP directive, it was throwing an error. PR is the fix for that issue. Added a fix for the following issue llvm#89559
- Loading branch information
1 parent
bc51a2e
commit 19c9348
Showing
2 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
flang/test/Parser/OpenMP/compiler-directive-continuation.f90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
! RUN: %flang_fc1 -fopenmp -E %s 2>&1 | FileCheck %s --check-prefix=CHECK-OMP | ||
! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s | ||
|
||
|
||
! Test in mixed way, i.e., combination of Fortran free source form | ||
! and free source form with conditional compilation sentinel. | ||
! CHECK-LABEL: subroutine mixed_form1() | ||
! CHECK-OMP: i = 1 +100+ 1000+ 10 + 1 +1000000000 + 1000000 | ||
! CHECK: i = 1 + 10 + 10000 + 1000000 | ||
subroutine mixed_form1() | ||
i = 1 & | ||
!$+100& | ||
!$&+ 1000& | ||
&+ 10 + 1& | ||
!$& +100000& | ||
&0000 + 1000000 | ||
end subroutine | ||
|
||
|
||
! Testing continuation lines in only Fortran Free form Source | ||
! CHECK-LABEL: subroutine mixed_form2() | ||
! CHECK-OMP: i = 1 +10 +100 + 1000 + 10000 | ||
! CHECK: i = 1 +10 +100 + 1000 + 10000 | ||
subroutine mixed_form2() | ||
i = 1 & | ||
+10 & | ||
&+100 | ||
& + 1000 & | ||
+ 10000 | ||
end subroutine | ||
|
||
|
||
! Testing continuation line in only free source form conditional compilation sentinel. | ||
! CHECK-LABEL: subroutine mixed_form3() | ||
! CHECK-OMP: i=0 | ||
! CHECK-OMP: i = 1 +10 +100+1000 | ||
subroutine mixed_form3() | ||
!$ i=0 | ||
!$ i = 1 & | ||
!$ & +10 & | ||
!$&+100& | ||
!$ +1000 | ||
end subroutine | ||
|