2015-10-18  Nathan Sidwell  <nathan@codesourcery.com>

	* c-c++-common/goacc/loop-2.c: Break apart to ...
	* c-c++-common/goacc/loop-3.c: ... here ...
	* c-c++-common/goacc/loop-4.c: ... here ...
	* c-c++-common/goacc/loop-nest-1.c: ... here ...
	* c-c++-common/goacc/loop-tile-k1.c: ... here ...
	* c-c++-common/goacc/loop-tile-p1.c: ... here.
	* gfortran.dg/goacc/loop-5.f95: Break apart to ...
	* gfortran.dg/goacc/loop-6.f95: ... here.

Index: c-c++-common/goacc/loop-2.c
===================================================================
--- c-c++-common/goacc/loop-2.c	(revision 228953)
+++ c-c++-common/goacc/loop-2.c	(working copy)
@@ -1,186 +1,10 @@
 /* { dg-do compile } */
-/* { dg-additional-options "-fmax-errors=200" } */
 
 int
 main ()
 {
   int i, j;
 
-#pragma acc kernels
-  {
-#pragma acc loop auto
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang(5)
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang(num:5)
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang(static:5)
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang(static:*)
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang // { dg-error "gang, worker and vector may occur only once in a loop nest" }
-    for (i = 0; i < 10; i++)
-      {
-#pragma acc loop vector 
-	for (j = 0; j < 10; j++)
-	  { }
-#pragma acc loop worker 
-	for (j = 0; j < 10; j++)
-	  { }
-#pragma acc loop gang
-	for (j = 0; j < 10; j++)
-	  { }
-      }
-#pragma acc loop seq gang // { dg-error "incompatible use of clause" }
-    for (i = 0; i < 10; i++)
-      { }
-
-#pragma acc loop worker
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop worker(5)
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop worker(num:5)
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop worker // { dg-error "gang, worker and vector may occur only once in a loop nest" }
-    for (i = 0; i < 10; i++)
-      {
-#pragma acc loop vector 
-	for (j = 0; j < 10; j++)
-	  { }
-#pragma acc loop worker
-	for (j = 0; j < 10; j++)
-	  { }
-#pragma acc loop gang
-	for (j = 0; j < 10; j++)
-	  { }
-      }
-#pragma acc loop seq worker // { dg-error "incompatible use of clause" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang worker
-    for (i = 0; i < 10; i++)
-      { }
-
-#pragma acc loop vector
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop vector(5)
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop vector(length:5)
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop vector // { dg-error "gang, worker and vector may occur only once in a loop nest" }
-    for (i = 0; i < 10; i++)
-      {
-#pragma acc loop vector
-	for (j = 1; j < 10; j++)
-	  { }
-#pragma acc loop worker
-	for (j = 1; j < 10; j++)
-	  { }
-#pragma acc loop gang
-	for (j = 1; j < 10; j++)
-	  { }
-      }
-#pragma acc loop seq vector // { dg-error "incompatible use of clause" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang vector
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop worker vector
-    for (i = 0; i < 10; i++)
-      { }
-
-#pragma acc loop auto
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop seq auto // { dg-error "incompatible use of clause" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang auto // { dg-error "incompatible use of clause" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop worker auto // { dg-error "incompatible use of clause" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop vector auto // { dg-error "incompatible use of clause" }
-    for (i = 0; i < 10; i++)
-      { }
-
-#pragma acc loop tile // { dg-error "expected" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile() // { dg-error "expected" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(1)
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(2)
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(6-2) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(6+2) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(*, 1) 
-    for (i = 0; i < 10; i++)
-      {
-	for (j = 0; j < 10; i++)
-	  { }
-      }
-#pragma acc loop tile(-1) // { dg-error "tile argument needs positive constant integer" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(i) // { dg-error "tile argument needs positive constant integer" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(2, 2, 1)
-    for (i = 2; i < 4; i++)
-      for (i = 4; i < 6; i++)
-	{ }
-#pragma acc loop tile(2, 2)
-    for (i = 1; i < 5; i+=2)
-      for (j = i+1; j < 7; i++)
-	{ }
-#pragma acc loop vector tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop worker tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop vector gang tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop vector worker tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang worker tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-  }
-
 
 #pragma acc parallel
   {
@@ -190,12 +14,6 @@ main ()
 #pragma acc loop gang
     for (i = 0; i < 10; i++)
       { }
-#pragma acc loop gang(5) // { dg-error "no arguments allowed to gang" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang(num:5) // { dg-error "no arguments allowed to gang" }
-    for (i = 0; i < 10; i++)
-      { }
 #pragma acc loop gang(static:5)
     for (i = 0; i < 10; i++)
       { }
@@ -222,13 +40,7 @@ main ()
 #pragma acc loop worker
     for (i = 0; i < 10; i++)
       { }
-#pragma acc loop worker(5) // { dg-error "no arguments allowed to gang" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop worker(num:5) // { dg-error "no arguments allowed to gang" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop worker // { dg-error "gang, worker and vector may occur only once in a loop" }
+#pragma acc loop worker // { dg-error "gang, worker and vector may occur only once in a loop nest" }
     for (i = 0; i < 10; i++)
       {
 #pragma acc loop vector 
@@ -251,10 +63,6 @@ main ()
 #pragma acc loop vector
     for (i = 0; i < 10; i++)
       { }
-#pragma acc loop vector(5) // { dg-error "no arguments allowed to gang" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop vector(length:5) // { dg-error "no arguments allowed to gang" }
     for (i = 0; i < 10; i++)
       { }
 #pragma acc loop vector // { dg-error "gang, worker and vector may occur only once in a loop nest" }
@@ -296,245 +104,21 @@ main ()
     for (i = 0; i < 10; i++)
       { }
 
-#pragma acc loop tile // { dg-error "expected" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile() // { dg-error "expected" }
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(1) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop tile(2) 
-    for (i = 0; i < 10; i++)
-      {
-	for (j = 1; j < 10; j++)
-	  { }
-      }
-#pragma acc loop tile(-1) // { dg-error "tile argument needs positive constant integer expression" }
-    for (i = 1; i < 10; i++)
-      { }
-#pragma acc loop tile(i) // { dg-error "tile argument needs positive constant integer expression" }
-    for (i = 1; i < 10; i++)
-      { }
-#pragma acc loop tile(2, 2, 1)
-    for (i = 1; i < 3; i++)
-      {
-	for (j = 4; j < 6; j++)
-	  { }
-      } 
-#pragma acc loop tile(2, 2)
-    for (i = 1; i < 5; i+=2)
-      {
-	for (j = i + 1; j < 7; j+=i)
-	  { }
-      }
-#pragma acc loop vector tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop worker tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop vector gang tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop vector worker tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
-#pragma acc loop gang worker tile(*) 
-    for (i = 0; i < 10; i++)
-      { }
   }
 
-#pragma acc kernels loop auto
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop gang
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop gang(5)
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop gang(num:5)
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop gang(static:5)
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop gang(static:*)
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop gang
-  for (i = 0; i < 10; i++)
-    {
-#pragma acc kernels loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-    }
-#pragma acc kernels loop seq gang // { dg-error "incompatible use of clause" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
-    { }
-
-#pragma acc kernels loop worker
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop worker(5)
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop worker(num:5)
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop worker
-  for (i = 0; i < 10; i++)
-    {
-#pragma acc kernels loop worker // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-#pragma acc kernels loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-    }
-#pragma acc kernels loop seq worker // { dg-error "incompatible use of clause" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
-    { }
-#pragma acc kernels loop gang worker
-  for (i = 0; i < 10; i++)
-    { }
-
-#pragma acc kernels loop vector
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop vector(5)
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop vector(length:5)
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop vector
-  for (i = 0; i < 10; i++)
-    {
-#pragma acc kernels loop vector // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-#pragma acc kernels loop worker // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-#pragma acc kernels loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-    }
-#pragma acc kernels loop seq vector // { dg-error "incompatible use of clause" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
-    { }
-#pragma acc kernels loop gang vector
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop worker vector
-  for (i = 0; i < 10; i++)
-    { }
-
-#pragma acc kernels loop auto
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop seq auto // { dg-error "incompatible use of clause" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
-    { }
-#pragma acc kernels loop gang auto // { dg-error "incompatible use of clause" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
-    { }
-#pragma acc kernels loop worker auto // { dg-error "incompatible use of clause" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
-    { }
-#pragma acc kernels loop vector auto // { dg-error "incompatible use of clause" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
-    { }
-
-#pragma acc kernels loop tile // { dg-error "expected" }
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop tile() // { dg-error "expected" }
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop tile(1) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop tile(*, 1) 
-  for (i = 0; i < 10; i++)
-    {
-      for (j = 1; j < 10; j++)
-	{ }
-    }
-#pragma acc kernels loop tile(-1) // { dg-error "tile argument needs positive constant integer expression" }
-  for (i = 1; i < 10; i++)
-    { }
-#pragma acc kernels loop tile(i) // { dg-error "tile argument needs positive constant integer expression" }
-  for (i = 1; i < 10; i++)
-    { }
-#pragma acc kernels loop tile(2, 2, 1)
-  for (i = 1; i < 3; i++)
-    {
-      for (j = 4; j < 6; j++)
-	{ }
-    }    
-#pragma acc kernels loop tile(2, 2)
-  for (i = 1; i < 5; i++)
-    {
-      for (j = i + 1; j < 7; j += i)
-	{ }
-    }
-#pragma acc kernels loop vector tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop worker tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop gang tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop vector gang tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop vector worker tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc kernels loop gang worker tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-
 #pragma acc parallel loop auto
   for (i = 0; i < 10; i++)
     { }
 #pragma acc parallel loop gang
   for (i = 0; i < 10; i++)
     { }
-#pragma acc parallel loop gang(5) // { dg-error "no arguments allowed to gang" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
-    { }
-#pragma acc parallel loop gang(num:5) // { dg-error "no arguments allowed to gang" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
-    { }
 #pragma acc parallel loop gang(static:5)
   for (i = 0; i < 10; i++)
     { }
 #pragma acc parallel loop gang(static:*)
   for (i = 0; i < 10; i++)
     { }
-#pragma acc parallel loop gang
-  for (i = 0; i < 10; i++)
-    {
-#pragma acc parallel loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
-    for (j = 1; j < 10; j++)
-      { }
-    }
+
 #pragma acc parallel loop seq gang // { dg-error "incompatible use of clause" "" { target c } }
   for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
     { }
@@ -542,22 +126,7 @@ main ()
 #pragma acc parallel loop worker
   for (i = 0; i < 10; i++)
     { }
-#pragma acc parallel loop worker(5) // { dg-error "no arguments allowed to gang" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
-    { }
-#pragma acc parallel loop worker(num:5) // { dg-error "no arguments allowed to gang" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
-    { }
-#pragma acc parallel loop worker
-  for (i = 0; i < 10; i++)
-    {
-#pragma acc parallel loop worker // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-#pragma acc parallel loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-    }
+
 #pragma acc parallel loop seq worker // { dg-error "incompatible use of clause" "" { target c } }
   for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
     { }
@@ -568,25 +137,7 @@ main ()
 #pragma acc parallel loop vector
   for (i = 0; i < 10; i++)
     { }
-#pragma acc parallel loop vector(5) // { dg-error "no arguments allowed to gang" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
-    { }
-#pragma acc parallel loop vector(length:5) // { dg-error "no arguments allowed to gang" "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
-    { }
-#pragma acc parallel loop vector
-  for (i = 0; i < 10; i++)
-    {
-#pragma acc parallel loop vector // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-#pragma acc parallel loop worker // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-#pragma acc parallel loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
-      for (j = 1; j < 10; j++)
-	{ }
-    }
+
 #pragma acc parallel loop seq vector // { dg-error "incompatible use of clause" "" { target c } }
   for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
     { }
@@ -603,8 +154,8 @@ main ()
 #pragma acc parallel loop seq auto // { dg-error "incompatible use of clause" "" { target c } }
   for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
     { }
-#pragma acc parallel loop gang auto // { dg-error "incompatible use of clause"  "" { target c } }
-  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause"  "" { target c++ } }
+#pragma acc parallel loop gang auto // { dg-error "incompatible use of clause" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
     { }
 #pragma acc parallel loop worker auto // { dg-error "incompatible use of clause" "" { target c } }
   for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
@@ -613,61 +164,6 @@ main ()
   for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
     { }
 
-#pragma acc parallel loop tile // { dg-error "expected" }
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc parallel loop tile() // { dg-error "expected" }
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc parallel loop tile(1) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc parallel loop tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc parallel loop tile(*, 1) 
-  for (i = 0; i < 10; i++)
-    {
-      for (j = 1; j < 10; j++)
-	{ }
-    }
-#pragma acc parallel loop tile(-1) // { dg-error "tile argument needs positive constant integer expression" }
-  for (i = 1; i < 10; i++)
-    { }
-#pragma acc parallel loop tile(i) // { dg-error "tile argument needs positive constant integer expression" }
-  for (i = 1; i < 10; i++)
-    { }
-#pragma acc parallel loop tile(2, 2, 1)
-  for (i = 1; i < 3; i++)
-    {
-      for (j = 4; j < 6; j++)
-        { }
-    }    
-#pragma acc parallel loop tile(2, 2)
-  for (i = 1; i < 5; i+=2)
-    {
-      for (j = i + 1; j < 7; j++)
-        { }
-    }
-#pragma acc parallel loop vector tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc parallel loop worker tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc parallel loop gang tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc parallel loop vector gang tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc parallel loop vector worker tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-#pragma acc parallel loop gang worker tile(*) 
-  for (i = 0; i < 10; i++)
-    { }
-
   return 0;
 }
 
Index: c-c++-common/goacc/loop-3.c
===================================================================
--- c-c++-common/goacc/loop-3.c	(revision 0)
+++ c-c++-common/goacc/loop-3.c	(working copy)
@@ -0,0 +1,132 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fmax-errors=200" } */
+
+
+void par1 (void)
+{
+  int i, j;
+
+#pragma acc parallel
+  {
+#pragma acc loop gang(5) // { dg-error "no arguments allowed to gang" }
+    for (i = 0; i < 10; i++)
+      { }
+
+#pragma acc loop gang(num:5) // { dg-error "no arguments allowed to gang" }
+    for (i = 0; i < 10; i++)
+      { }
+
+#pragma acc loop worker(5) // { dg-error "no arguments allowed to gang" }
+    for (i = 0; i < 10; i++)
+      { }
+
+#pragma acc loop worker(num:5) // { dg-error "no arguments allowed to gang" }
+    for (i = 0; i < 10; i++)
+      { }
+
+#pragma acc loop vector(5) // { dg-error "no arguments allowed to gang" }
+    for (i = 0; i < 10; i++)
+      { }
+
+#pragma acc loop vector(length:5) // { dg-error "no arguments allowed to gang" }
+    for (i = 0; i < 10; i++)
+      { }
+
+   }
+}
+
+void k2 (void)
+{
+  int i, j;
+
+#pragma acc kernels loop gang
+  for (i = 0; i < 10; i++)
+    {
+#pragma acc kernels loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+    }
+
+#pragma acc kernels loop worker
+  for (i = 0; i < 10; i++)
+    {
+#pragma acc kernels loop worker // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+#pragma acc kernels loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+    }
+  
+#pragma acc kernels loop vector
+  for (i = 0; i < 10; i++)
+    {
+#pragma acc kernels loop vector // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+#pragma acc kernels loop worker // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+#pragma acc kernels loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+    }
+}
+
+void p2 (void)
+{
+  int i, j;
+
+#pragma acc parallel loop gang(5) // { dg-error "no arguments allowed to gang" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
+    { }
+#pragma acc parallel loop gang(num:5) // { dg-error "no arguments allowed to gang" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
+    { }
+
+#pragma acc parallel loop gang
+  for (i = 0; i < 10; i++)
+    {
+#pragma acc parallel loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
+    for (j = 1; j < 10; j++) 
+      { }
+    }
+
+#pragma acc parallel loop worker(5) // { dg-error "no arguments allowed to gang" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
+    { }
+#pragma acc parallel loop worker(num:5) // { dg-error "no arguments allowed to gang" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
+    { }
+#pragma acc parallel loop worker
+  for (i = 0; i < 10; i++)
+    {
+#pragma acc parallel loop worker // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+#pragma acc parallel loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+    }
+
+#pragma acc parallel loop vector(5) // { dg-error "no arguments allowed to gang" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
+    { }
+#pragma acc parallel loop vector(length:5) // { dg-error "no arguments allowed to gang" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "no arguments allowed to gang" "" { target c++ } }
+    { }
+#pragma acc parallel loop vector
+  for (i = 0; i < 10; i++)
+    {
+#pragma acc parallel loop vector // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+#pragma acc parallel loop worker // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+#pragma acc parallel loop gang // { dg-error "OpenACC construct inside of non-OpenACC region" }
+      for (j = 1; j < 10; j++)
+	{ }
+    }
+}
+
Index: c-c++-common/goacc/loop-4.c
===================================================================
--- c-c++-common/goacc/loop-4.c	(revision 0)
+++ c-c++-common/goacc/loop-4.c	(working copy)
@@ -0,0 +1,196 @@
+/* { dg-do compile } */
+
+int
+main ()
+{
+  int i, j;
+
+#pragma acc kernels
+  {
+#pragma acc loop auto
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang(5)
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang(num:5)
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang(static:5)
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang(static:*)
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang // { dg-error "gang, worker and vector may occur only once in a loop nest" }
+    for (i = 0; i < 10; i++)
+      {
+#pragma acc loop vector 
+	for (j = 0; j < 10; j++)
+	  { }
+#pragma acc loop worker 
+	for (j = 0; j < 10; j++)
+	  { }
+#pragma acc loop gang
+	for (j = 0; j < 10; j++)
+	  { }
+      }
+#pragma acc loop seq gang // { dg-error "incompatible use of clause" }
+    for (i = 0; i < 10; i++)
+      { }
+
+#pragma acc loop worker
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop worker(5)
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop worker(num:5)
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop worker // { dg-error "gang, worker and vector may occur only once in a loop nest" }
+    for (i = 0; i < 10; i++)
+      {
+#pragma acc loop vector 
+	for (j = 0; j < 10; j++)
+	  { }
+#pragma acc loop worker
+	for (j = 0; j < 10; j++)
+	  { }
+#pragma acc loop gang
+	for (j = 0; j < 10; j++)
+	  { }
+      }
+#pragma acc loop seq worker // { dg-error "incompatible use of clause" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang worker
+    for (i = 0; i < 10; i++)
+      { }
+
+#pragma acc loop vector
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop vector(5)
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop vector(length:5)
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop vector // { dg-error "gang, worker and vector may occur only once in a loop nest" }
+    for (i = 0; i < 10; i++)
+      {
+#pragma acc loop vector
+	for (j = 1; j < 10; j++)
+	  { }
+#pragma acc loop worker
+	for (j = 1; j < 10; j++)
+	  { }
+#pragma acc loop gang
+	for (j = 1; j < 10; j++)
+	  { }
+      }
+#pragma acc loop seq vector // { dg-error "incompatible use of clause" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang vector
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop worker vector
+    for (i = 0; i < 10; i++)
+      { }
+
+#pragma acc loop auto
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop seq auto // { dg-error "incompatible use of clause" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang auto // { dg-error "incompatible use of clause" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop worker auto // { dg-error "incompatible use of clause" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop vector auto // { dg-error "incompatible use of clause" }
+    for (i = 0; i < 10; i++)
+      { }
+
+  }
+
+
+#pragma acc kernels loop auto
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop gang
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop gang(5)
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop gang(num:5)
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop gang(static:5)
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop gang(static:*)
+  for (i = 0; i < 10; i++)
+    { }
+  
+#pragma acc kernels loop worker
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop worker(5)
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop worker(num:5)
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop seq worker // { dg-error "incompatible use of clause" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
+    { }
+#pragma acc kernels loop gang worker
+  for (i = 0; i < 10; i++)
+    { }
+
+#pragma acc kernels loop vector
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop vector(5)
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop vector(length:5)
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop seq vector // { dg-error "incompatible use of clause" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
+    { }
+#pragma acc kernels loop gang vector
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop worker vector
+  for (i = 0; i < 10; i++)
+    { }
+
+#pragma acc kernels loop auto
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop seq auto // { dg-error "incompatible use of clause" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
+    { }
+#pragma acc kernels loop gang auto // { dg-error "incompatible use of clause" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
+    { }
+#pragma acc kernels loop worker auto // { dg-error "incompatible use of clause" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
+    { }
+#pragma acc kernels loop vector auto // { dg-error "incompatible use of clause" "" { target c } }
+  for (i = 0; i < 10; i++) // { dg-error "incompatible use of clause" "" { target c++ } }
+    { }
+
+  return 0;
+}
Index: c-c++-common/goacc/loop-nest-1.c
===================================================================
--- c-c++-common/goacc/loop-nest-1.c	(revision 0)
+++ c-c++-common/goacc/loop-nest-1.c	(working copy)
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+int
+main ()
+{
+  int i, j;
+#pragma acc kernels loop gang
+  for (i = 0; i < 10; i++)
+    {
+#pragma acc kernels loop gang // { dg-error "OpenACC construct inside of" "" }
+      for (i = 0; i < 10; i++)
+	{ }
+    }
+
+  return 0;
+}
Index: c-c++-common/goacc/loop-tile-k1.c
===================================================================
--- c-c++-common/goacc/loop-tile-k1.c	(revision 0)
+++ c-c++-common/goacc/loop-tile-k1.c	(working copy)
@@ -0,0 +1,132 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fmax-errors=200" } */
+
+void
+kern (void)
+{
+  int i, j;
+
+#pragma acc kernels
+  {
+#pragma acc loop tile // { dg-error "expected" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile() // { dg-error "expected" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(1)
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(2)
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(6-2) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(6+2) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(*, 1) 
+    for (i = 0; i < 10; i++)
+      {
+	for (j = 0; j < 10; i++)
+	  { }
+      }
+#pragma acc loop tile(-1) // { dg-error "tile argument needs positive constant integer" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(i) // { dg-error "tile argument needs positive constant integer" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(2, 2, 1)
+    for (i = 2; i < 4; i++)
+      for (i = 4; i < 6; i++)
+	{ }
+#pragma acc loop tile(2, 2)
+    for (i = 1; i < 5; i+=2)
+      for (j = i+1; j < 7; i++)
+	{ }
+#pragma acc loop vector tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop worker tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop vector gang tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop vector worker tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang worker tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+   }
+}
+
+
+void k3 (void)
+{
+  int i, j;
+
+#pragma acc kernels loop tile // { dg-error "expected" }
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop tile() // { dg-error "expected" }
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop tile(1) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop tile(*, 1) 
+  for (i = 0; i < 10; i++)
+    {
+      for (j = 1; j < 10; j++)
+	{ }
+    }
+#pragma acc kernels loop tile(-1) // { dg-error "tile argument needs positive constant integer expression" }
+  for (i = 1; i < 10; i++)
+    { }
+#pragma acc kernels loop tile(i) // { dg-error "tile argument needs positive constant integer expression" }
+  for (i = 1; i < 10; i++)
+    { }
+#pragma acc kernels loop tile(2, 2, 1)
+  for (i = 1; i < 3; i++)
+    {
+      for (j = 4; j < 6; j++)
+	{ }
+    }    
+#pragma acc kernels loop tile(2, 2)
+  for (i = 1; i < 5; i++)
+    {
+      for (j = i + 1; j < 7; j += i)
+	{ }
+    }
+#pragma acc kernels loop vector tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop worker tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop gang tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop vector gang tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop vector worker tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc kernels loop gang worker tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+}
Index: c-c++-common/goacc/loop-tile-p1.c
===================================================================
--- c-c++-common/goacc/loop-tile-p1.c	(revision 0)
+++ c-c++-common/goacc/loop-tile-p1.c	(working copy)
@@ -0,0 +1,128 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fmax-errors=200" } */
+
+
+void par (void)
+{
+  int i, j;
+
+#pragma acc parallel
+  {
+#pragma acc loop tile // { dg-error "expected" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile() // { dg-error "expected" }
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(1) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop tile(2) 
+    for (i = 0; i < 10; i++)
+      {
+	for (j = 1; j < 10; j++)
+	  { }
+      }
+#pragma acc loop tile(-1) // { dg-error "tile argument needs positive constant integer expression" }
+    for (i = 1; i < 10; i++)
+      { }
+#pragma acc loop tile(i) // { dg-error "tile argument needs positive constant integer expression" }
+    for (i = 1; i < 10; i++)
+      { }
+#pragma acc loop tile(2, 2, 1)
+    for (i = 1; i < 3; i++)
+      {
+	for (j = 4; j < 6; j++)
+	  { }
+      } 
+#pragma acc loop tile(2, 2)
+    for (i = 1; i < 5; i+=2)
+      {
+	for (j = i + 1; j < 7; j+=i)
+	  { }
+      }
+#pragma acc loop vector tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop worker tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop vector gang tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop vector worker tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+#pragma acc loop gang worker tile(*) 
+    for (i = 0; i < 10; i++)
+      { }
+  }
+}
+void p3 (void)
+{
+  int i, j;
+
+  
+#pragma acc parallel loop tile // { dg-error "expected" }
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc parallel loop tile() // { dg-error "expected" }
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc parallel loop tile(1) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc parallel loop tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc parallel loop tile(*, 1) 
+  for (i = 0; i < 10; i++)
+    {
+      for (j = 1; j < 10; j++)
+	{ }
+    }
+#pragma acc parallel loop tile(-1) // { dg-error "tile argument needs positive constant integer expression" }
+  for (i = 1; i < 10; i++)
+    { }
+#pragma acc parallel loop tile(i) // { dg-error "tile argument needs positive constant integer expression" }
+  for (i = 1; i < 10; i++)
+    { }
+#pragma acc parallel loop tile(2, 2, 1)
+  for (i = 1; i < 3; i++)
+    {
+      for (j = 4; j < 6; j++)
+        { }
+    }    
+#pragma acc parallel loop tile(2, 2)
+  for (i = 1; i < 5; i+=2)
+    {
+      for (j = i + 1; j < 7; j++)
+        { }
+    }
+#pragma acc parallel loop vector tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc parallel loop worker tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc parallel loop gang tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc parallel loop vector gang tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc parallel loop vector worker tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+#pragma acc parallel loop gang worker tile(*) 
+  for (i = 0; i < 10; i++)
+    { }
+
+}
+
Index: gfortran.dg/goacc/loop-5.f95
===================================================================
--- gfortran.dg/goacc/loop-5.f95	(revision 228953)
+++ gfortran.dg/goacc/loop-5.f95	(working copy)
@@ -123,64 +123,6 @@ program test
 
 
   !$acc parallel
-    !$acc loop auto
-    DO i = 1,10
-    ENDDO
-    !$acc loop gang
-    DO i = 1,10
-    ENDDO
-    !$acc loop gang(static:5)
-    DO i = 1,10
-    ENDDO
-    !$acc loop gang(static:*)
-    DO i = 1,10
-    ENDDO
-    !$acc loop gang
-    DO i = 1,10
-      !$acc loop vector
-      DO j = 1,10
-      ENDDO
-      !$acc loop worker
-      DO j = 1,10
-      ENDDO
-    ENDDO
-
-    !$acc loop worker
-    DO i = 1,10
-    ENDDO
-    !$acc loop worker
-    DO i = 1,10
-      !$acc loop vector
-      DO j = 1,10
-      ENDDO
-    ENDDO
-    !$acc loop gang worker
-    DO i = 1,10
-    ENDDO
-
-    !$acc loop vector
-    DO i = 1,10
-    ENDDO
-    !$acc loop vector(5) ! { dg-error "no arguments allowed to gang, worker and vector clauses inside parallel" }
-    DO i = 1,10
-    ENDDO
-    !$acc loop vector(length:5) ! { dg-error "no arguments allowed to gang, worker and vector clauses inside parallel" }
-    DO i = 1,10
-    ENDDO
-    !$acc loop vector
-    DO i = 1,10
-    ENDDO
-    !$acc loop gang vector
-    DO i = 1,10
-    ENDDO
-    !$acc loop worker vector
-    DO i = 1,10
-    ENDDO
-
-    !$acc loop auto
-    DO i = 1,10
-    ENDDO
-
     !$acc loop tile(1)
     DO i = 1,10
     ENDDO
@@ -364,15 +306,6 @@ program test
 
   !$acc parallel loop vector
   DO i = 1,10
-  ENDDO
-  !$acc parallel loop vector(5) ! { dg-error "no arguments allowed to gang, worker and vector clauses inside parallel" }
-  DO i = 1,10
-  ENDDO
-  !$acc parallel loop vector(length:5) ! { dg-error "no arguments allowed to gang, worker and vector clauses inside parallel" }
-  DO i = 1,10
-  ENDDO
-  !$acc parallel loop vector
-  DO i = 1,10
     !$acc parallel loop vector ! { dg-error "OpenACC construct inside of non-OpenACC region" }
     DO j = 1,10
     ENDDO
Index: gfortran.dg/goacc/loop-6.f95
===================================================================
--- gfortran.dg/goacc/loop-6.f95	(revision 0)
+++ gfortran.dg/goacc/loop-6.f95	(working copy)
@@ -0,0 +1,79 @@
+! { dg-do compile }
+! { dg-additional-options "-fmax-errors=100" }
+
+! TODO: nested kernels are allowed in 2.0
+
+program test
+  implicit none
+  integer :: i, j
+
+  !$acc parallel
+    !$acc loop auto
+    DO i = 1,10
+    ENDDO
+    !$acc loop gang
+    DO i = 1,10
+    ENDDO
+    !$acc loop gang(static:5)
+    DO i = 1,10
+    ENDDO
+    !$acc loop gang(static:*)
+    DO i = 1,10
+    ENDDO
+    !$acc loop gang
+    DO i = 1,10
+      !$acc loop vector
+      DO j = 1,10
+      ENDDO
+      !$acc loop worker
+      DO j = 1,10
+      ENDDO
+    ENDDO
+
+    !$acc loop worker
+    DO i = 1,10
+    ENDDO
+    !$acc loop worker
+    DO i = 1,10
+      !$acc loop vector
+      DO j = 1,10
+      ENDDO
+    ENDDO
+    !$acc loop gang worker
+    DO i = 1,10
+    ENDDO
+
+    !$acc loop vector
+    DO i = 1,10
+    ENDDO
+    !$acc loop vector(5) ! { dg-error "no arguments allowed to gang" }
+    DO i = 1,10
+    ENDDO
+    !$acc loop vector(length:5) ! { dg-error "no arguments allowed to gang" }
+    DO i = 1,10
+    ENDDO
+    !$acc loop vector
+    DO i = 1,10
+    ENDDO
+    !$acc loop gang vector
+    DO i = 1,10
+    ENDDO
+    !$acc loop worker vector
+    DO i = 1,10
+    ENDDO
+
+    !$acc loop auto
+    DO i = 1,10
+    ENDDO
+  !$acc end parallel
+
+  !$acc parallel loop vector
+  DO i = 1,10
+  ENDDO
+  !$acc parallel loop vector(5) ! { dg-error "no arguments allowed to gang" }
+  DO i = 1,10
+  ENDDO
+  !$acc parallel loop vector(length:5) ! { dg-error "no arguments allowed to gang" }
+  DO i = 1,10
+  ENDDO
+end
