]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gimplify.c (gimplify_omp_ordered): Fix up diagnostics wording.
authorJakub Jelinek <jakub@redhat.com>
Fri, 6 Nov 2015 21:21:16 +0000 (22:21 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 6 Nov 2015 21:21:16 +0000 (22:21 +0100)
* gimplify.c (gimplify_omp_ordered): Fix up diagnostics
wording.
* omp-low.c (check_omp_nesting_restrictions): Update for the
various new OpenMP 4.5 nesting restrictions, clarified
nesting glossary, closely nested region relationship clarified
to mean explicit or implicit parallel regions (target/teams),
use %</%> or %qs where appropriate.

* gcc.dg/gomp/ordered-2.c (f1): Expect an extra error.
* g++.dg/gomp/ordered-2.C (f1): Likewise.
* gfortran.dg/goacc/parallel-kernels-regions.f95: Adjust
expected diagnostics for the addition of quotes.
* gfortran.dg/gomp/target3.f90: Likewise.
* c-c++-common/goacc/nesting-fail-1.c: Likewise.
* c-c++-common/goacc-gomp/nesting-fail-1.c: Likewise.
* c-c++-common/gomp/doacross-1.c: Likewise.
* c-c++-common/gomp/nesting-warn-1.c: Likewise.
* c-c++-common/gomp/cancel-1.c (f2): Add some new tests.
Adjust expected diagnostics wording.
* c-c++-common/gomp/clauses-4.c (foo): Likewise.
Don't expect error on ordered threads simd when in for simd.
* c-c++-common/gomp/nesting-2.c: New test.
* c-c++-common/gomp/ordered-3.c (foo): Add some new tests.
* c-c++-common/gomp/ordered-4.c: New test.

From-SVN: r229892

17 files changed:
gcc/ChangeLog
gcc/gimplify.c
gcc/omp-low.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c
gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c
gcc/testsuite/c-c++-common/gomp/cancel-1.c
gcc/testsuite/c-c++-common/gomp/clauses-4.c
gcc/testsuite/c-c++-common/gomp/doacross-1.c
gcc/testsuite/c-c++-common/gomp/nesting-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/nesting-warn-1.c
gcc/testsuite/c-c++-common/gomp/ordered-3.c
gcc/testsuite/c-c++-common/gomp/ordered-4.c [new file with mode: 0644]
gcc/testsuite/g++.dg/gomp/ordered-2.C
gcc/testsuite/gcc.dg/gomp/ordered-2.c
gcc/testsuite/gfortran.dg/goacc/parallel-kernels-regions.f95
gcc/testsuite/gfortran.dg/gomp/target3.f90

index c5c9eedd864274193f7a7f5b619d5d8a7525340c..7c19722b4923e7fa54f10d3ad926487287716fa5 100644 (file)
@@ -1,3 +1,13 @@
+2015-11-06  Jakub Jelinek  <jakub@redhat.com>
+
+       * gimplify.c (gimplify_omp_ordered): Fix up diagnostics
+       wording.
+       * omp-low.c (check_omp_nesting_restrictions): Update for the
+       various new OpenMP 4.5 nesting restrictions, clarified
+       nesting glossary, closely nested region relationship clarified
+       to mean explicit or implicit parallel regions (target/teams),
+       use %</%> or %qs where appropriate.
+
 2015-11-06  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 
index fa348585a241cbe6ab7e5914dc240e6eaba11d7b..1fed426210f908809e6d48981c29de97db48f3af 100644 (file)
@@ -9259,9 +9259,9 @@ gimplify_omp_ordered (tree expr, gimple_seq body)
              || OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_SOURCE))
        {
          error_at (OMP_CLAUSE_LOCATION (c),
-                   "%<depend%> clause must be closely nested "
-                   "inside a loop with %<ordered%> clause with "
-                   "a parameter");
+                   "%<ordered%> construct with %<depend%> clause must be "
+                   "closely nested inside a loop with %<ordered%> clause "
+                   "with a parameter");
          failures++;
        }
       else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND
index 5ffb27650596714bcda8151f15879aac2ba7e99c..45d1927f678e27291f14ceb8c0273a04236a2f88 100644 (file)
@@ -3112,9 +3112,9 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
   if (!(is_gimple_omp (stmt)
        && is_gimple_omp_oacc (stmt)))
     {
-      for (omp_context *ctx_ = ctx; ctx_ != NULL; ctx_ = ctx_->outer)
-       if (is_gimple_omp (ctx_->stmt)
-           && is_gimple_omp_oacc (ctx_->stmt)
+      for (omp_context *octx = ctx; octx != NULL; octx = octx->outer)
+       if (is_gimple_omp (octx->stmt)
+           && is_gimple_omp_oacc (octx->stmt)
            /* Except for atomic codes that we share with OpenMP.  */
            && ! (gimple_code (stmt) == GIMPLE_OMP_ATOMIC_LOAD
                  || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_STORE))
@@ -3134,12 +3134,27 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
          if (gimple_code (stmt) == GIMPLE_OMP_ORDERED)
            {
              c = gimple_omp_ordered_clauses (as_a <gomp_ordered *> (stmt));
-             if (c && OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SIMD)
-               return true;
+             if (find_omp_clause (c, OMP_CLAUSE_SIMD))
+               {
+                 if (find_omp_clause (c, OMP_CLAUSE_THREADS)
+                     && (ctx->outer == NULL
+                         || !gimple_omp_for_combined_into_p (ctx->stmt)
+                         || gimple_code (ctx->outer->stmt) != GIMPLE_OMP_FOR
+                         || (gimple_omp_for_kind (ctx->outer->stmt)
+                             != GF_OMP_FOR_KIND_FOR)
+                         || !gimple_omp_for_combined_p (ctx->outer->stmt)))
+                   {
+                     error_at (gimple_location (stmt),
+                               "%<ordered simd threads%> must be closely "
+                               "nested inside of %<for simd%> region");
+                     return false;
+                   }
+                 return true;
+               }
            }
          error_at (gimple_location (stmt),
                    "OpenMP constructs other than %<#pragma omp ordered simd%>"
-                   " may not be nested inside simd region");
+                   " may not be nested inside %<simd%> region");
          return false;
        }
       else if (gimple_code (ctx->stmt) == GIMPLE_OMP_TEAMS)
@@ -3150,8 +3165,9 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
              && gimple_code (stmt) != GIMPLE_OMP_PARALLEL)
            {
              error_at (gimple_location (stmt),
-                       "only distribute or parallel constructs are allowed to "
-                       "be closely nested inside teams construct");
+                       "only %<distribute%> or %<parallel%> regions are "
+                       "allowed to be strictly nested inside %<teams%> "
+                       "region");
              return false;
            }
        }
@@ -3166,8 +3182,8 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
          if (ctx != NULL && gimple_code (ctx->stmt) != GIMPLE_OMP_TEAMS)
            {
              error_at (gimple_location (stmt),
-                       "distribute construct must be closely nested inside "
-                       "teams construct");
+                       "%<distribute%> region must be strictly nested "
+                       "inside %<teams%> construct");
              return false;
            }
          return true;
@@ -3222,13 +3238,15 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
        {
          const char *bad = NULL;
          const char *kind = NULL;
+         const char *construct
+           = (DECL_FUNCTION_CODE (gimple_call_fndecl (stmt))
+              == BUILT_IN_GOMP_CANCEL)
+             ? "#pragma omp cancel"
+             : "#pragma omp cancellation point";
          if (ctx == NULL)
            {
              error_at (gimple_location (stmt), "orphaned %qs construct",
-                       DECL_FUNCTION_CODE (gimple_call_fndecl (stmt))
-                       == BUILT_IN_GOMP_CANCEL
-                       ? "#pragma omp cancel"
-                       : "#pragma omp cancellation point");
+                       construct);
              return false;
            }
          switch (tree_fits_shwi_p (gimple_call_arg (stmt, 0))
@@ -3304,7 +3322,33 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
              if (gimple_code (ctx->stmt) != GIMPLE_OMP_TASK)
                bad = "#pragma omp task";
              else
-               ctx->cancellable = true;
+               {
+                 for (omp_context *octx = ctx->outer;
+                      octx; octx = octx->outer)
+                   {
+                     switch (gimple_code (octx->stmt))
+                       {
+                       case GIMPLE_OMP_TASKGROUP:
+                         break;
+                       case GIMPLE_OMP_TARGET:
+                         if (gimple_omp_target_kind (octx->stmt)
+                             != GF_OMP_TARGET_KIND_REGION)
+                           continue;
+                         /* FALLTHRU */
+                       case GIMPLE_OMP_PARALLEL:
+                       case GIMPLE_OMP_TEAMS:
+                         error_at (gimple_location (stmt),
+                                   "%<%s taskgroup%> construct not closely "
+                                   "nested inside of %<taskgroup%> region",
+                                   construct);
+                         return false;
+                       default:
+                         continue;
+                       }
+                     break;
+                   }
+                 ctx->cancellable = true;
+               }
              kind = "taskgroup";
              break;
            default:
@@ -3315,10 +3359,7 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
            {
              error_at (gimple_location (stmt),
                        "%<%s %s%> construct not closely nested inside of %qs",
-                       DECL_FUNCTION_CODE (gimple_call_fndecl (stmt))
-                       == BUILT_IN_GOMP_CANCEL
-                       ? "#pragma omp cancel"
-                       : "#pragma omp cancellation point", kind, bad);
+                       construct, kind, bad);
              return false;
            }
        }
@@ -3329,6 +3370,10 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
        switch (gimple_code (ctx->stmt))
          {
          case GIMPLE_OMP_FOR:
+           if (gimple_omp_for_kind (ctx->stmt) != GF_OMP_FOR_KIND_FOR
+               && gimple_omp_for_kind (ctx->stmt) != GF_OMP_FOR_KIND_TASKLOOP)
+             break;
+           /* FALLTHRU */
          case GIMPLE_OMP_SECTIONS:
          case GIMPLE_OMP_SINGLE:
          case GIMPLE_OMP_ORDERED:
@@ -3342,17 +3387,24 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
                  return true;
                error_at (gimple_location (stmt),
                          "barrier region may not be closely nested inside "
-                         "of work-sharing, critical, ordered, master or "
-                         "explicit task region");
+                         "of work-sharing, %<critical%>, %<ordered%>, "
+                         "%<master%>, explicit %<task%> or %<taskloop%> "
+                         "region");
                return false;
              }
            error_at (gimple_location (stmt),
                      "work-sharing region may not be closely nested inside "
-                     "of work-sharing, critical, ordered, master or explicit "
-                     "task region");
+                     "of work-sharing, %<critical%>, %<ordered%>, "
+                     "%<master%>, explicit %<task%> or %<taskloop%> region");
            return false;
          case GIMPLE_OMP_PARALLEL:
+         case GIMPLE_OMP_TEAMS:
            return true;
+         case GIMPLE_OMP_TARGET:
+           if (gimple_omp_target_kind (ctx->stmt)
+               == GF_OMP_TARGET_KIND_REGION)
+             return true;
+           break;
          default:
            break;
          }
@@ -3362,15 +3414,26 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
        switch (gimple_code (ctx->stmt))
          {
          case GIMPLE_OMP_FOR:
+           if (gimple_omp_for_kind (ctx->stmt) != GF_OMP_FOR_KIND_FOR
+               && gimple_omp_for_kind (ctx->stmt) != GF_OMP_FOR_KIND_TASKLOOP)
+             break;
+           /* FALLTHRU */
          case GIMPLE_OMP_SECTIONS:
          case GIMPLE_OMP_SINGLE:
          case GIMPLE_OMP_TASK:
            error_at (gimple_location (stmt),
-                     "master region may not be closely nested inside "
-                     "of work-sharing or explicit task region");
+                     "%<master%> region may not be closely nested inside "
+                     "of work-sharing, explicit %<task%> or %<taskloop%> "
+                     "region");
            return false;
          case GIMPLE_OMP_PARALLEL:
+         case GIMPLE_OMP_TEAMS:
            return true;
+         case GIMPLE_OMP_TARGET:
+           if (gimple_omp_target_kind (ctx->stmt)
+               == GF_OMP_TARGET_KIND_REGION)
+             return true;
+           break;
          default:
            break;
          }
@@ -3395,8 +3458,7 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
          if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_DEPEND)
            {
              gcc_assert (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_THREADS
-                         || (ctx == NULL
-                             && OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SIMD));
+                         || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SIMD);
              continue;
            }
          enum omp_clause_depend_kind kind = OMP_CLAUSE_DEPEND_KIND (c);
@@ -3412,23 +3474,40 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
                                           OMP_CLAUSE_ORDERED)) == NULL_TREE)
                {
                  error_at (OMP_CLAUSE_LOCATION (c),
-                           "%<depend%> clause must be closely nested "
-                           "inside an ordered loop");
+                           "%<ordered%> construct with %<depend%> clause "
+                           "must be closely nested inside an %<ordered%> "
+                           "loop");
                  return false;
                }
              else if (OMP_CLAUSE_ORDERED_EXPR (oclause) == NULL_TREE)
                {
                  error_at (OMP_CLAUSE_LOCATION (c),
-                           "%<depend%> clause must be closely nested "
-                           "inside a loop with %<ordered%> clause with "
-                           "a parameter");
+                           "%<ordered%> construct with %<depend%> clause "
+                           "must be closely nested inside a loop with "
+                           "%<ordered%> clause with a parameter");
                  return false;
                }
            }
          else
            {
              error_at (OMP_CLAUSE_LOCATION (c),
-                       "invalid depend kind in omp ordered depend");
+                       "invalid depend kind in omp %<ordered%> %<depend%>");
+             return false;
+           }
+       }
+      c = gimple_omp_ordered_clauses (as_a <gomp_ordered *> (stmt));
+      if (find_omp_clause (c, OMP_CLAUSE_SIMD))
+       {
+         /* ordered simd must be closely nested inside of simd region,
+            and simd region must not encounter constructs other than
+            ordered simd, therefore ordered simd may be either orphaned,
+            or ctx->stmt must be simd.  The latter case is handled already
+            earlier.  */
+         if (ctx != NULL)
+           {
+             error_at (gimple_location (stmt),
+                       "%<ordered%> %<simd%> must be closely nested inside "
+                       "%<simd%> region");
              return false;
            }
        }
@@ -3437,24 +3516,35 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
          {
          case GIMPLE_OMP_CRITICAL:
          case GIMPLE_OMP_TASK:
+         case GIMPLE_OMP_ORDERED:
+         ordered_in_taskloop:
            error_at (gimple_location (stmt),
-                     "ordered region may not be closely nested inside "
-                     "of critical or explicit task region");
+                     "%<ordered%> region may not be closely nested inside "
+                     "of %<critical%>, %<ordered%>, explicit %<task%> or "
+                     "%<taskloop%> region");
            return false;
          case GIMPLE_OMP_FOR:
+           if (gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_TASKLOOP)
+             goto ordered_in_taskloop;
            if (find_omp_clause (gimple_omp_for_clauses (ctx->stmt),
                                 OMP_CLAUSE_ORDERED) == NULL)
              {
                error_at (gimple_location (stmt),
-                         "ordered region must be closely nested inside "
-                         "a loop region with an ordered clause");
+                         "%<ordered%> region must be closely nested inside "
+                         "a loop region with an %<ordered%> clause");
                return false;
              }
            return true;
+         case GIMPLE_OMP_TARGET:
+           if (gimple_omp_target_kind (ctx->stmt)
+               != GF_OMP_TARGET_KIND_REGION)
+             break;
+           /* FALLTHRU */
          case GIMPLE_OMP_PARALLEL:
+         case GIMPLE_OMP_TEAMS:
            error_at (gimple_location (stmt),
-                     "ordered region must be closely nested inside "
-                     "a loop region with an ordered clause");
+                     "%<ordered%> region must be closely nested inside "
+                     "a loop region with an %<ordered%> clause");
            return false;
          default:
            break;
@@ -3470,8 +3560,8 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
            if (this_stmt_name == gimple_omp_critical_name (other_crit))
              {
                error_at (gimple_location (stmt),
-                         "critical region may not be nested inside a critical "
-                         "region with the same name");
+                         "%<critical%> region may not be nested inside "
+                          "a %<critical%> region with the same name");
                return false;
              }
       }
@@ -3482,8 +3572,8 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
          || gimple_omp_target_kind (ctx->stmt) != GF_OMP_TARGET_KIND_REGION)
        {
          error_at (gimple_location (stmt),
-                   "teams construct not closely nested inside of target "
-                   "region");
+                   "%<teams%> construct not closely nested inside of "
+                   "%<target%> construct");
          return false;
        }
       break;
@@ -3549,7 +3639,7 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
              != is_gimple_omp_oacc (ctx->stmt))
            {
              error_at (gimple_location (stmt),
-                       "%s %s construct inside of %s %s region",
+                       "%s %qs construct inside of %s %qs region",
                        (is_gimple_omp_oacc (stmt)
                         ? "OpenACC" : "OpenMP"), stmt_name,
                        (is_gimple_omp_oacc (ctx->stmt)
@@ -3562,15 +3652,14 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
              if (is_gimple_omp_oacc (ctx->stmt))
                {
                  error_at (gimple_location (stmt),
-                           "%s construct inside of %s region",
+                           "%qs construct inside of %qs region",
                            stmt_name, ctx_stmt_name);
                  return false;
                }
              else
                {
-                 gcc_checking_assert (!is_gimple_omp_oacc (stmt));
                  warning_at (gimple_location (stmt), 0,
-                             "%s construct inside of %s region",
+                             "%qs construct inside of %qs region",
                              stmt_name, ctx_stmt_name);
                }
            }
index a74c02d8374099dfda0a3a961f99719ba6ee9063..725273be54136b364f0fad49b619c20ff9b9cdd0 100644 (file)
@@ -1,3 +1,22 @@
+2015-11-06  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.dg/gomp/ordered-2.c (f1): Expect an extra error.
+       * g++.dg/gomp/ordered-2.C (f1): Likewise.
+       * gfortran.dg/goacc/parallel-kernels-regions.f95: Adjust
+       expected diagnostics for the addition of quotes.
+       * gfortran.dg/gomp/target3.f90: Likewise.
+       * c-c++-common/goacc/nesting-fail-1.c: Likewise.
+       * c-c++-common/goacc-gomp/nesting-fail-1.c: Likewise.
+       * c-c++-common/gomp/doacross-1.c: Likewise.
+       * c-c++-common/gomp/nesting-warn-1.c: Likewise.
+       * c-c++-common/gomp/cancel-1.c (f2): Add some new tests.
+       Adjust expected diagnostics wording.
+       * c-c++-common/gomp/clauses-4.c (foo): Likewise.
+       Don't expect error on ordered threads simd when in for simd.
+       * c-c++-common/gomp/nesting-2.c: New test.
+       * c-c++-common/gomp/ordered-3.c (foo): Add some new tests.
+       * c-c++-common/gomp/ordered-4.c: New test.
+
 2015-11-06  Mike Stump  <mikestump@comcast.net>
 
        * gcc.dg/pragma-diag-5.c: Make test cases unique.
index e98258c3353c5be0ef47cf999c946418c872c144..1a4472107c676c3f503cecf888b1946ce3b1f9a0 100644 (file)
@@ -151,15 +151,15 @@ f_omp (void)
 
 #pragma omp target
   {
-#pragma acc parallel /* { dg-error "OpenACC parallel construct inside of OpenMP target region" } */
+#pragma acc parallel /* { dg-error "OpenACC .parallel. construct inside of OpenMP .target. region" } */
     ;
-#pragma acc kernels /* { dg-error "OpenACC kernels construct inside of OpenMP target region" } */
+#pragma acc kernels /* { dg-error "OpenACC .kernels. construct inside of OpenMP .target. region" } */
     ;
-#pragma acc data /* { dg-error "OpenACC data construct inside of OpenMP target region" } */
+#pragma acc data /* { dg-error "OpenACC .data. construct inside of OpenMP .target. region" } */
     ;
-#pragma acc update host(i) /* { dg-error "OpenACC update construct inside of OpenMP target region" } */
-#pragma acc enter data copyin(i) /* { dg-error "OpenACC enter/exit data construct inside of OpenMP target region" } */
-#pragma acc exit data delete(i) /* { dg-error "OpenACC enter/exit data construct inside of OpenMP target region" } */
+#pragma acc update host(i) /* { dg-error "OpenACC .update. construct inside of OpenMP .target. region" } */
+#pragma acc enter data copyin(i) /* { dg-error "OpenACC .enter/exit data. construct inside of OpenMP .target. region" } */
+#pragma acc exit data delete(i) /* { dg-error "OpenACC .enter/exit data. construct inside of OpenMP .target. region" } */
 #pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
     for (i = 0; i < 2; ++i)
       ;
index 8af1c8244f09e4cafc20b396628f18969928dfb4..7a36074ae384fd78e4a69e07e21e58911da54a63 100644 (file)
@@ -7,15 +7,15 @@ f_acc_parallel (void)
 {
 #pragma acc parallel
   {
-#pragma acc parallel /* { dg-bogus "parallel construct inside of parallel region" "not implemented" { xfail *-*-* } } */
+#pragma acc parallel /* { dg-bogus ".parallel. construct inside of .parallel. region" "not implemented" { xfail *-*-* } } */
     ;
-#pragma acc kernels /* { dg-bogus "kernels construct inside of parallel region" "not implemented" { xfail *-*-* } } */
+#pragma acc kernels /* { dg-bogus ".kernels. construct inside of .parallel. region" "not implemented" { xfail *-*-* } } */
     ;
-#pragma acc data /* { dg-error "data construct inside of parallel region" } */
+#pragma acc data /* { dg-error ".data. construct inside of .parallel. region" } */
     ;
-#pragma acc update host(i) /* { dg-error "update construct inside of parallel region" } */
-#pragma acc enter data copyin(i) /* { dg-error "enter/exit data construct inside of parallel region" } */
-#pragma acc exit data delete(i) /* { dg-error "enter/exit data construct inside of parallel region" } */
+#pragma acc update host(i) /* { dg-error ".update. construct inside of .parallel. region" } */
+#pragma acc enter data copyin(i) /* { dg-error ".enter/exit data. construct inside of .parallel. region" } */
+#pragma acc exit data delete(i) /* { dg-error ".enter/exit data. construct inside of .parallel. region" } */
   }
 }
 
@@ -26,14 +26,14 @@ f_acc_kernels (void)
 {
 #pragma acc kernels
   {
-#pragma acc parallel /* { dg-bogus "parallel construct inside of kernels region" "not implemented" { xfail *-*-* } } */
+#pragma acc parallel /* { dg-bogus ".parallel. construct inside of .kernels. region" "not implemented" { xfail *-*-* } } */
     ;
-#pragma acc kernels /* { dg-bogus "kernels construct inside of kernels region" "not implemented" { xfail *-*-* } } */
+#pragma acc kernels /* { dg-bogus ".kernels. construct inside of .kernels. region" "not implemented" { xfail *-*-* } } */
     ;
-#pragma acc data /* { dg-error "data construct inside of kernels region" } */
+#pragma acc data /* { dg-error ".data. construct inside of .kernels. region" } */
     ;
-#pragma acc update host(i) /* { dg-error "update construct inside of kernels region" } */
-#pragma acc enter data copyin(i) /* { dg-error "enter/exit data construct inside of kernels region" } */
-#pragma acc exit data delete(i) /* { dg-error "enter/exit data construct inside of kernels region" } */
+#pragma acc update host(i) /* { dg-error ".update. construct inside of .kernels. region" } */
+#pragma acc enter data copyin(i) /* { dg-error ".enter/exit data. construct inside of .kernels. region" } */
+#pragma acc exit data delete(i) /* { dg-error ".enter/exit data. construct inside of .kernels. region" } */
   }
 }
index 13de881d049a8c608930dbdd73020c2732bb4197..896a76858bd3172addfdfc7befe21061e431a400 100644 (file)
@@ -73,6 +73,18 @@ f2 (void)
       #pragma omp cancellation point taskgroup /* { dg-error "not closely nested inside" } */
     }
     #pragma omp task
+    {
+      #pragma omp cancel parallel              /* { dg-error "not closely nested inside" } */
+      #pragma omp cancel for                   /* { dg-error "not closely nested inside" } */
+      #pragma omp cancel sections              /* { dg-error "not closely nested inside" } */
+      #pragma omp cancel taskgroup             /* { dg-error "construct not closely nested inside of .taskgroup. region" } */
+      #pragma omp cancellation point parallel  /* { dg-error "not closely nested inside" } */
+      #pragma omp cancellation point for       /* { dg-error "not closely nested inside" } */
+      #pragma omp cancellation point sections  /* { dg-error "not closely nested inside" } */
+      #pragma omp cancellation point taskgroup /* { dg-error "construct not closely nested inside of .taskgroup. region" } */
+    }
+    #pragma omp taskgroup
+    #pragma omp task
     {
       #pragma omp cancel parallel              /* { dg-error "not closely nested inside" } */
       #pragma omp cancel for                   /* { dg-error "not closely nested inside" } */
@@ -83,6 +95,55 @@ f2 (void)
       #pragma omp cancellation point sections  /* { dg-error "not closely nested inside" } */
       #pragma omp cancellation point taskgroup
     }
+    #pragma omp taskgroup
+    {
+      #pragma omp task
+      {
+       #pragma omp task
+       {
+         #pragma omp cancellation point taskgroup
+         #pragma omp cancel taskgroup
+       }
+      }
+    }
+    #pragma omp taskgroup
+    {
+      #pragma omp parallel
+      {
+       #pragma omp task
+       {
+         #pragma omp cancel taskgroup          /* { dg-error "construct not closely nested inside of .taskgroup. region" } */
+         #pragma omp cancellation point taskgroup /* { dg-error "construct not closely nested inside of .taskgroup. region" } */
+       }
+      }
+      #pragma omp target
+      {
+       #pragma omp task
+       {
+         #pragma omp cancel taskgroup          /* { dg-error "construct not closely nested inside of .taskgroup. region" } */
+         #pragma omp cancellation point taskgroup /* { dg-error "construct not closely nested inside of .taskgroup. region" } */
+       }
+      }
+      #pragma omp target
+      #pragma omp teams
+      #pragma omp distribute
+      for (i = 0; i < 10; i++)
+       {
+         #pragma omp task
+         {
+           #pragma omp cancel taskgroup        /* { dg-error "construct not closely nested inside of .taskgroup. region" } */
+           #pragma omp cancellation point taskgroup /* { dg-error "construct not closely nested inside of .taskgroup. region" } */
+         }
+       }
+      #pragma omp target data map(i)
+      {
+       #pragma omp task
+       {
+         #pragma omp cancel taskgroup
+         #pragma omp cancellation point taskgroup
+       }
+      }
+    }
     #pragma omp for
     for (i = 0; i < 10; i++)
       {
@@ -179,14 +240,14 @@ f2 (void)
   }
   #pragma omp target teams
   {
-    #pragma omp cancel parallel                        /* { dg-error "only distribute or parallel constructs are allowed to be closely nested" } */
-    #pragma omp cancel for                     /* { dg-error "only distribute or parallel constructs are allowed to be closely nested" } */
-    #pragma omp cancel sections                        /* { dg-error "only distribute or parallel constructs are allowed to be closely nested" } */
-    #pragma omp cancel taskgroup               /* { dg-error "only distribute or parallel constructs are allowed to be closely nested" } */
-    #pragma omp cancellation point parallel    /* { dg-error "only distribute or parallel constructs are allowed to be closely nested" } */
-    #pragma omp cancellation point for         /* { dg-error "only distribute or parallel constructs are allowed to be closely nested" } */
-    #pragma omp cancellation point sections    /* { dg-error "only distribute or parallel constructs are allowed to be closely nested" } */
-    #pragma omp cancellation point taskgroup   /* { dg-error "only distribute or parallel constructs are allowed to be closely nested" } */
+    #pragma omp cancel parallel                        /* { dg-error "only .distribute. or .parallel. regions are allowed to be strictly nested" } */
+    #pragma omp cancel for                     /* { dg-error "only .distribute. or .parallel. regions are allowed to be strictly nested" } */
+    #pragma omp cancel sections                        /* { dg-error "only .distribute. or .parallel. regions are allowed to be strictly nested" } */
+    #pragma omp cancel taskgroup               /* { dg-error "only .distribute. or .parallel. regions are allowed to be strictly nested" } */
+    #pragma omp cancellation point parallel    /* { dg-error "only .distribute. or .parallel. regions are allowed to be strictly nested" } */
+    #pragma omp cancellation point for         /* { dg-error "only .distribute. or .parallel. regions are allowed to be strictly nested" } */
+    #pragma omp cancellation point sections    /* { dg-error "only .distribute. or .parallel. regions are allowed to be strictly nested" } */
+    #pragma omp cancellation point taskgroup   /* { dg-error "only .distribute. or .parallel. regions are allowed to be strictly nested" } */
   }
   #pragma omp target teams distribute
   for (i = 0; i < 10; i++)
index 104b129a9aa7f72118c3d74577fbcc7f71220ac5..11e7634e14b9b10342874f5f26e3d357c8495b3e 100644 (file)
@@ -57,40 +57,62 @@ foo (int y, short z)
   #pragma omp distribute parallel for ordered          /* { dg-error ".ordered. is not valid for .#pragma omp distribute parallel for." } */
   for (x = 0; x < 64; x++)
     {
-      #pragma omp ordered      /* { dg-error "ordered region must be closely nested inside a loop region with an ordered clause" } */
+      #pragma omp ordered      /* { dg-error ".ordered. region must be closely nested inside a loop region with an .ordered. clause" } */
       ;
     }
   #pragma omp target teams
   #pragma omp distribute parallel for simd ordered     /* { dg-error ".ordered. is not valid for .#pragma omp distribute parallel for simd." } */
   for (x = 0; x < 64; x++)
     {
-      #pragma omp ordered simd, threads        /* { dg-error "OpenMP constructs other than .#pragma omp ordered simd. may not be nested inside simd region" } */
+      #pragma omp ordered simd, threads
       ;
     }
   #pragma omp target
   #pragma omp teams distribute parallel for ordered            /* { dg-error ".ordered. is not valid for .#pragma omp teams distribute parallel for." } */
   for (x = 0; x < 64; x++)
     {
-      #pragma omp ordered      /* { dg-error "ordered region must be closely nested inside a loop region with an ordered clause" } */
+      #pragma omp ordered      /* { dg-error ".ordered. region must be closely nested inside a loop region with an .ordered. clause" } */
       ;
     }
   #pragma omp target
   #pragma omp teams distribute parallel for simd ordered       /* { dg-error ".ordered. is not valid for .#pragma omp teams distribute parallel for simd." } */
   for (x = 0; x < 64; x++)
     {
-      #pragma omp ordered simd, threads        /* { dg-error "OpenMP constructs other than .#pragma omp ordered simd. may not be nested inside simd region" } */
+      #pragma omp ordered simd, threads
       ;
     }
   #pragma omp target teams distribute parallel for ordered             /* { dg-error ".ordered. is not valid for .#pragma omp target teams distribute parallel for." } */
   for (x = 0; x < 64; x++)
     {
-      #pragma omp ordered      /* { dg-error "ordered region must be closely nested inside a loop region with an ordered clause" } */
+      #pragma omp ordered      /* { dg-error ".ordered. region must be closely nested inside a loop region with an .ordered. clause" } */
       ;
     }
   #pragma omp target teams distribute parallel for simd ordered        /* { dg-error ".ordered. is not valid for .#pragma omp target teams distribute parallel for simd." } */
   for (x = 0; x < 64; x++)
     {
-      #pragma omp ordered simd, threads        /* { dg-error "OpenMP constructs other than .#pragma omp ordered simd. may not be nested inside simd region" } */
+      #pragma omp ordered simd, threads
+      ;
+    }
+  #pragma omp simd
+  for (x = 0; x < 64; x++)
+    {
+      #pragma omp ordered threads simd         /* { dg-error ".ordered simd threads. must be closely nested inside of .for simd. region" } */
+      ;
+    }
+  #pragma omp for
+  for (x = 0; x < 64; x++)
+    {
+      #pragma omp simd
+      for (y = 0; y < 16; y++)
+       {
+         #pragma omp ordered simd threads      /* { dg-error ".ordered simd threads. must be closely nested inside of .for simd. region" } */
+         ;
+       }
+    }
+  #pragma omp for simd
+  for (x = 0; x < 64; x++)
+    {
+      #pragma omp ordered threads simd
       ;
     }
 }
index 89c3dd3c7c6f669d6c457ea24aa74fca45ecb1c5..6244ca08d2c9d94cbefcd84cb7838b3975affadc 100644 (file)
@@ -32,8 +32,8 @@ foo (void)
          #pragma omp ordered depend (sink: i - 1, j - 2) /* { dg-error "does not match number" } */
          #pragma omp ordered depend (source)
        }
-  #pragma omp ordered depend (sink: j)                 /* { dg-error "clause must be closely nested inside an ordered loop" } */
-  #pragma omp ordered depend (source)                  /* { dg-error "clause must be closely nested inside an ordered loop" } */
+  #pragma omp ordered depend (sink: j)                 /* { dg-error "clause must be closely nested inside an .ordered. loop" } */
+  #pragma omp ordered depend (source)                  /* { dg-error "clause must be closely nested inside an .ordered. loop" } */
   #pragma omp for ordered (1)
   for (i = 0; i < 64; i++)
     {
diff --git a/gcc/testsuite/c-c++-common/gomp/nesting-2.c b/gcc/testsuite/c-c++-common/gomp/nesting-2.c
new file mode 100644 (file)
index 0000000..7a03430
--- /dev/null
@@ -0,0 +1,154 @@
+void
+foo (void)
+{
+  int i;
+  #pragma omp taskloop
+  for (i = 0; i < 64; i++)
+    {
+      int j;
+      #pragma omp for                  /* { dg-error "region may not be closely nested inside of" } */
+      for (j = 0; j < 10; j++)
+       ;
+      #pragma omp single               /* { dg-error "region may not be closely nested inside of" } */
+      ;
+      #pragma omp sections             /* { dg-error "region may not be closely nested inside of" } */
+      {
+       #pragma omp section
+       ;
+      }
+      #pragma omp barrier              /* { dg-error "region may not be closely nested inside of" } */
+      #pragma omp master               /* { dg-error "region may not be closely nested inside of" } */
+      ;
+      #pragma omp ordered              /* { dg-error "region may not be closely nested inside of" } */
+      ;
+      #pragma omp ordered threads      /* { dg-error "region may not be closely nested inside of" } */
+      ;
+      #pragma omp ordered simd threads /* { dg-error ".ordered. .simd. must be closely nested inside .simd. region" } */
+      ;
+      #pragma omp simd
+      for (j = 0; j < 10; j++)
+       #pragma omp ordered simd
+         ;
+      #pragma omp critical
+      {
+       #pragma omp simd
+       for (j = 0; j < 10; j++)
+         #pragma omp ordered simd
+           ;
+      }
+    }
+  #pragma omp taskloop
+  for (i = 0; i < 64; i++)
+    #pragma omp parallel
+    {
+      int j;
+      #pragma omp for
+      for (j = 0; j < 10; j++)
+       ;
+      #pragma omp single
+      ;
+      #pragma omp sections
+      {
+       #pragma omp section
+       ;
+      }
+      #pragma omp barrier
+      #pragma omp master
+      ;
+      #pragma omp ordered              /* { dg-error ".ordered. region must be closely nested inside a loop region with an .ordered. clause" } */
+      ;
+      #pragma omp ordered threads      /* { dg-error ".ordered. region must be closely nested inside a loop region with an .ordered. clause" } */
+      ;
+      #pragma omp simd
+      for (j = 0; j < 10; j++)
+       #pragma omp ordered simd
+         ;
+      #pragma omp critical
+      {
+       #pragma omp simd
+       for (j = 0; j < 10; j++)
+         #pragma omp ordered simd
+           ;
+      }
+    }
+  #pragma omp taskloop
+  for (i = 0; i < 64; i++)
+    #pragma omp target
+    {
+      int j;
+      #pragma omp for
+      for (j = 0; j < 10; j++)
+       ;
+      #pragma omp single
+      ;
+      #pragma omp sections
+      {
+       #pragma omp section
+       ;
+      }
+      #pragma omp barrier
+      #pragma omp master
+      ;
+      #pragma omp ordered              /* { dg-error ".ordered. region must be closely nested inside a loop region with an .ordered. clause" } */
+      ;
+      #pragma omp ordered threads      /* { dg-error ".ordered. region must be closely nested inside a loop region with an .ordered. clause" } */
+      ;
+      #pragma omp simd
+      for (j = 0; j < 10; j++)
+       #pragma omp ordered simd
+         ;
+      #pragma omp critical
+      {
+       #pragma omp simd
+       for (j = 0; j < 10; j++)
+         #pragma omp ordered simd
+           ;
+      }
+    }
+  #pragma omp ordered
+  {
+    #pragma omp ordered                        /* { dg-error "region may not be closely nested inside of" } */
+    ;
+  }
+  #pragma omp ordered threads
+  {
+    #pragma omp ordered                        /* { dg-error "region may not be closely nested inside of" } */
+    ;
+  }
+  #pragma omp ordered
+  {
+    #pragma omp ordered threads                /* { dg-error "region may not be closely nested inside of" } */
+    ;
+  }
+  #pragma omp ordered threads
+  {
+    #pragma omp ordered threads                /* { dg-error "region may not be closely nested inside of" } */
+    ;
+  }
+  #pragma omp critical
+  {
+    #pragma omp ordered simd           /* { dg-error ".ordered. .simd. must be closely nested inside .simd. region" } */
+    ;
+  }
+  #pragma omp for ordered
+  for (i = 0; i < 64; i++)
+    #pragma omp parallel
+    {
+      #pragma omp ordered threads      /* { dg-error ".ordered. region must be closely nested inside a loop region with an .ordered. clause" } */
+      ;
+    }
+  #pragma omp for ordered
+  for (i = 0; i < 64; i++)
+    #pragma omp parallel
+    {
+      #pragma omp ordered              /* { dg-error ".ordered. region must be closely nested inside a loop region with an .ordered. clause" } */
+      ;
+    }
+  #pragma omp for ordered(1)
+  for (i = 0; i < 64; i++)
+    #pragma omp parallel
+    {
+      #pragma omp ordered depend(source)       /* { dg-error ".ordered. construct with .depend. clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
+      #pragma omp ordered depend(sink: i - 1)  /* { dg-error ".ordered. construct with .depend. clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
+    }
+}
index 92ced7099078eccb2bbc738f96431ac70c179425..800ad5321087986e70beb7c5437098de069a4015 100644 (file)
@@ -5,19 +5,19 @@ f_omp_target (void)
 {
 #pragma omp target
   {
-#pragma omp target /* { dg-warning "target construct inside of target region" } */
+#pragma omp target /* { dg-warning ".target. construct inside of .target. region" } */
     ;
-#pragma omp target data map(i) /* { dg-warning "target data construct inside of target region" } */
+#pragma omp target data map(i) /* { dg-warning ".target data. construct inside of .target. region" } */
     ;
-#pragma omp target update to(i) /* { dg-warning "target update construct inside of target region" } */
+#pragma omp target update to(i) /* { dg-warning ".target update. construct inside of .target. region" } */
 
 #pragma omp parallel
     {
-#pragma omp target /* { dg-warning "target construct inside of target region" } */
+#pragma omp target /* { dg-warning ".target. construct inside of .target. region" } */
       ;
-#pragma omp target data map(i) /* { dg-warning "target data construct inside of target region" } */
+#pragma omp target data map(i) /* { dg-warning ".target data. construct inside of .target. region" } */
       ;
-#pragma omp target update to(i) /* { dg-warning "target update construct inside of target region" } */
+#pragma omp target update to(i) /* { dg-warning ".target update. construct inside of .target. region" } */
     }
   }
 }
index 1d7ff80f74386fbbc348b6c8f6171262ee3b2787..3c107232c0dd5a824c84e1d21922858ef5dec3cb 100644 (file)
@@ -59,6 +59,18 @@ foo (void)
       #pragma omp ordered depend(sink: i - 1)  /* { dg-error "clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
       #pragma omp ordered depend(source)       /* { dg-error "clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
     }
+  #pragma omp parallel for ordered
+  for (i = 0; i < 64; i++)
+    {
+      #pragma omp ordered depend(sink: i - 1)  /* { dg-error "clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
+      #pragma omp ordered depend(source)       /* { dg-error "clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
+    }
+  #pragma omp parallel for
+  for (i = 0; i < 64; i++)
+    {
+      #pragma omp ordered depend(sink: i - 1)  /* { dg-error "clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
+      #pragma omp ordered depend(source)       /* { dg-error "clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
+    }
 }
 
 void
diff --git a/gcc/testsuite/c-c++-common/gomp/ordered-4.c b/gcc/testsuite/c-c++-common/gomp/ordered-4.c
new file mode 100644 (file)
index 0000000..b56843c
--- /dev/null
@@ -0,0 +1,54 @@
+void
+f1 (void)
+{
+  int i, j;
+  #pragma omp critical
+  {
+    #pragma omp simd
+    for (i = 0; i < 64; i++)
+      {
+       #pragma omp ordered simd
+       ;
+      }
+  }
+  #pragma omp ordered threads
+  {
+    #pragma omp simd
+    for (i = 0; i < 64; i++)
+      {
+       #pragma omp ordered simd
+       ;
+      }
+  }
+  #pragma omp task
+  {
+    #pragma omp simd
+    for (i = 0; i < 64; i++)
+      {
+       #pragma omp ordered simd
+       ;
+      }
+  }
+  #pragma omp taskloop
+  for (j = 0; j < 64; j++)
+    #pragma omp simd
+    for (i = 0; i < 64; i++)
+      {
+       #pragma omp ordered simd
+       ;
+      }
+}
+
+void
+f2 (void)
+{
+  #pragma omp ordered simd
+  ;
+}
+
+void
+f3 (void)
+{
+  #pragma omp ordered threads , simd
+  ;
+}
index 6c2b4329c64f0ef77490707c31c820fac0ebd068..7ec6333527a26d1abd46d525603a6c2b36c545e1 100644 (file)
@@ -3,5 +3,5 @@
 void f1(void)
 {
   #pragma omp ordered asdf     /* { dg-error "expected" } */
-  #pragma omp ordered
+  #pragma omp ordered          /* { dg-error "region may not be closely nested inside of" } */
 }                              /* { dg-error "expected" } */
index 2884b10261c2d1cb7ff609cd66b49365892fd8ed..1107c37381a3b04c1164fbe0ca35c5a031354d70 100644 (file)
@@ -3,5 +3,5 @@
 void f1(void)
 {
   #pragma omp ordered asdf     /* { dg-error "expected" } */
-  #pragma omp ordered
+  #pragma omp ordered          /* { dg-error "region may not be closely nested inside of" } */
 }                              /* { dg-error "expected expression" } */
index 8b8e989399514d7dc134fb8af00e6fc4c5d032fa..7d8fb928659708d604f32e5769a95ab58ebf2209 100644 (file)
@@ -9,46 +9,46 @@ program test
   integer :: i
 
   !$acc parallel
-    !$acc kernels ! { dg-bogus "kernels construct inside of parallel region" "not implemented" { xfail *-*-* } }
+    !$acc kernels ! { dg-bogus ".kernels. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
     !$acc end kernels
   !$acc end parallel
 
   !$acc parallel
-    !$acc parallel ! { dg-bogus "parallel construct inside of parallel region" "not implemented" { xfail *-*-* } }
+    !$acc parallel ! { dg-bogus ".parallel. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
     !$acc end parallel
   !$acc end parallel
 
   !$acc parallel
-    !$acc parallel ! { dg-bogus "parallel construct inside of parallel region" "not implemented" { xfail *-*-* } }
+    !$acc parallel ! { dg-bogus ".parallel. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
     !$acc end parallel
-    !$acc kernels ! { dg-bogus "kernels construct inside of parallel region" "not implemented" { xfail *-*-* } }
+    !$acc kernels ! { dg-bogus ".kernels. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
     !$acc end kernels
   !$acc end parallel
 
   !$acc kernels
-    !$acc kernels ! { dg-bogus "kernels construct inside of kernels region" "not implemented" { xfail *-*-* } }
+    !$acc kernels ! { dg-bogus ".kernels. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
     !$acc end kernels
   !$acc end kernels
 
   !$acc kernels
-    !$acc parallel ! { dg-bogus "parallel construct inside of kernels region" "not implemented" { xfail *-*-* } }
+    !$acc parallel ! { dg-bogus ".parallel. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
     !$acc end parallel
   !$acc end kernels
 
   !$acc kernels
-    !$acc parallel ! { dg-bogus "parallel construct inside of kernels region" "not implemented" { xfail *-*-* } }
+    !$acc parallel ! { dg-bogus ".parallel. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
     !$acc end parallel
-    !$acc kernels ! { dg-bogus "kernels construct inside of kernels region" "not implemented" { xfail *-*-* } }
+    !$acc kernels ! { dg-bogus ".kernels. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
     !$acc end kernels
   !$acc end kernels
 
   !$acc parallel
-    !$acc data ! { dg-error "data construct inside of parallel region" }
+    !$acc data ! { dg-error ".data. construct inside of .parallel. region" }
     !$acc end data
   !$acc end parallel
 
   !$acc kernels
-    !$acc data ! { dg-error "data construct inside of kernels region" }
+    !$acc data ! { dg-error ".data. construct inside of .kernels. region" }
     !$acc end data
   !$acc end kernels
   
index 53a9682bf96a5fe31faa3775a2604d8221a808f1..7ba42a040374b3c73f3a3e0020ce0e26c4083432 100644 (file)
@@ -4,7 +4,7 @@
 subroutine foo (r)
   integer :: i, r
   !$omp target
-  !$omp target teams distribute parallel do reduction (+: r) ! { dg-warning "target construct inside of target region" }
+  !$omp target teams distribute parallel do reduction (+: r) ! { dg-warning ".target. construct inside of .target. region" }
     do i = 1, 10
       r = r + 1
     end do