Fortran version of commit
5079b7781a2c506dcdfb241347d74c7891268225
gcc/fortran/ChangeLog:
* match.h (gfc_match_omp_nothing): New.
* openmp.c (gfc_match_omp_nothing): New.
* parse.c (decode_omp_directive): Match 'nothing' directive.
gcc/testsuite/ChangeLog:
* gfortran.dg/nothing-1.f90: New test.
* gfortran.dg/nothing-2.f90: New test.
match gfc_match_omp_master (void);
match gfc_match_omp_master_taskloop (void);
match gfc_match_omp_master_taskloop_simd (void);
+match gfc_match_omp_nothing (void);
match gfc_match_omp_ordered (void);
match gfc_match_omp_ordered_depend (void);
match gfc_match_omp_parallel (void);
return match_omp (EXEC_OMP_ORDERED, OMP_ORDERED_CLAUSES);
}
+match
+gfc_match_omp_nothing (void)
+{
+ if (gfc_match_omp_eos () != MATCH_YES)
+ {
+ gfc_error ("Unexpected junk after $OMP NOTHING statement at %C");
+ return MATCH_ERROR;
+ }
+ /* Will use ST_NONE; therefore, no EXEC_OMP_ is needed. */
+ return MATCH_YES;
+}
match
gfc_match_omp_ordered_depend (void)
ST_OMP_MASTER_TASKLOOP);
matcho ("master", gfc_match_omp_master, ST_OMP_MASTER);
break;
+ case 'n':
+ matcho ("nothing", gfc_match_omp_nothing, ST_NONE);
+ break;
case 'l':
matcho ("loop", gfc_match_omp_loop, ST_OMP_LOOP);
break;
--- /dev/null
+module m
+ implicit none (type, external)
+ !$omp nothing
+
+ type t
+ !$omp nothing
+ integer s
+ end type
+
+contains
+
+integer function foo (i)
+ integer :: i
+
+ !$omp nothing
+ if (.false.) &
+& & !$omp nothing
+ i = i + 1
+
+! In the following, '& & !$' is not a valid OpenMP sentinel and,
+! hence, the line is regarded as comment
+ if (.false.) &
+& & !$omp nothing
+ then
+ end if
+ foo = i
+end
+end module
--- /dev/null
+pure subroutine foo
+ !$omp nothing ! { dg-error "OpenMP directives other than SIMD or DECLARE TARGET at .1. may not appear in PURE procedures" }
+end subroutine
+
+subroutine bar
+ !$omp nothing foo ! { dg-error "Unexpected junk after $OMP NOTHING statement" }
+end