Skip to content

Commit 0a56d91

Browse files
committed
[FLANG][OPENMP] Resolved nitpicks and added missing directive check.
1 parent 087f7e1 commit 0a56d91

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

flang/lib/Parser/prescan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ const char *Prescanner::FreeFormContinuationLine(bool ampersand) {
12971297
return nullptr;
12981298
}
12991299
}
1300-
} else if (features_.IsEnabled(LanguageFeature::OpenMP)) {
1300+
} else if (features_.IsEnabled(LanguageFeature::OpenMP) && *p == '$') {
13011301
++p;
13021302
} else {
13031303
return nullptr;

flang/test/Parser/compiler-directive_continuation.f90 renamed to flang/test/Parser/OpenMP/compiler-directive-continuation.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
! RUN: flang-new -fopenmp -E %s 2>&1 | FileCheck %s --check-prefix=CHECK-OMP
2-
! RUN: flang-new -E %s 2>&1 | FileCheck %s
1+
! RUN: %flang_fc1 -fopenmp -E %s 2>&1 | FileCheck %s --check-prefix=CHECK-OMP
2+
! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s
33

44

55
! Test in mixed way, i.e., combination of Fortran free source form
@@ -18,10 +18,10 @@ subroutine mixed_form1()
1818

1919

2020
! Testing continuation lines in only Fortran Free form Source
21-
! CHECK-LABEL: subroutine mixed_form3()
21+
! CHECK-LABEL: subroutine mixed_form2()
2222
! CHECK-OMP: i = 1 +10 +100 + 1000 + 10000
2323
! CHECK: i = 1 +10 +100 + 1000 + 10000
24-
subroutine mixed_form3()
24+
subroutine mixed_form2()
2525
i = 1 &
2626
+10 &
2727
&+100
@@ -31,10 +31,10 @@ subroutine mixed_form3()
3131

3232

3333
! Testing continuation line in only free source form conditional compilation sentinel.
34-
! CHECK-LABEL: subroutine mixed_form4()
34+
! CHECK-LABEL: subroutine mixed_form3()
3535
! CHECK-OMP: i=0
3636
! CHECK-OMP: i = 1 +10 +100+1000
37-
subroutine mixed_form4()
37+
subroutine mixed_form3()
3838
!$ i=0
3939
!$ i = 1 &
4040
!$ & +10 &

0 commit comments

Comments
 (0)