Accept commas between clauses in OpenMP declare variant
Add support to the Fortran parser for the OpenMP syntax that allows a comma after the directive name and between clauses of declare variant. The C and C++ parsers already support this syntax so only a new test is added. gcc/fortran/ChangeLog: * openmp.cc (gfc_match_omp_declare_variant): Match comma after directive name and between clauses. Emit more useful diagnostics. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/declare-variant-2.f90: Remove error test for a comma after the directive name. Add tests for other invalid syntaxes (extra comma and invalid clause). * c-c++-common/gomp/adjust-args-5.c: New test. * gfortran.dg/gomp/adjust-args-11.f90: New test.
Showing
- gcc/fortran/openmp.cc 13 additions, 10 deletionsgcc/fortran/openmp.cc
- gcc/testsuite/c-c++-common/gomp/adjust-args-5.c 21 additions, 0 deletionsgcc/testsuite/c-c++-common/gomp/adjust-args-5.c
- gcc/testsuite/gfortran.dg/gomp/adjust-args-11.f90 45 additions, 0 deletionsgcc/testsuite/gfortran.dg/gomp/adjust-args-11.f90
- gcc/testsuite/gfortran.dg/gomp/declare-variant-2.f90 8 additions, 2 deletionsgcc/testsuite/gfortran.dg/gomp/declare-variant-2.f90
Loading
Please register or sign in to comment