This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[4/6] OpenMP 4.0 gcc testsuite


Hi!

2013-10-08  Jakub Jelinek  <jakub@redhat.com>

gcc/testsuite/
	* c-c++-common/gomp/atomic-15.c: Adjust for C diagnostics.
	Remove error test that is now valid in OpenMP 4.0.
	* c-c++-common/gomp/atomic-16.c: New test.
	* c-c++-common/gomp/cancel-1.c: New test.
	* c-c++-common/gomp/depend-1.c: New test.
	* c-c++-common/gomp/depend-2.c: New test.
	* c-c++-common/gomp/map-1.c: New test.
	* c-c++-common/gomp/pr58472.c: New test.
	* c-c++-common/gomp/sections1.c: New test.
	* c-c++-common/gomp/simd1.c: New test.
	* c-c++-common/gomp/simd2.c: New test.
	* c-c++-common/gomp/simd3.c: New test.
	* c-c++-common/gomp/simd4.c: New test.
	* c-c++-common/gomp/simd5.c: New test.
	* c-c++-common/gomp/single1.c: New test.
	* g++.dg/gomp/block-0.C: Adjust for stricter #pragma omp sections
	parser.
	* g++.dg/gomp/block-3.C: Likewise.
	* g++.dg/gomp/clause-3.C: Adjust error messages.
	* g++.dg/gomp/declare-simd-1.C: New test.
	* g++.dg/gomp/declare-simd-2.C: New test.
	* g++.dg/gomp/depend-1.C: New test.
	* g++.dg/gomp/depend-2.C: New test.
	* g++.dg/gomp/target-1.C: New test.
	* g++.dg/gomp/target-2.C: New test.
	* g++.dg/gomp/taskgroup-1.C: New test.
	* g++.dg/gomp/teams-1.C: New test.
	* g++.dg/gomp/udr-1.C: New test.
	* g++.dg/gomp/udr-2.C: New test.
	* g++.dg/gomp/udr-3.C: New test.
	* g++.dg/gomp/udr-4.C: New test.
	* g++.dg/gomp/udr-5.C: New test.
	* gcc.dg/autopar/outer-1.c: Expect 4 instead of 5 loopfn matches.
	* gcc.dg/autopar/outer-2.c: Likewise.
	* gcc.dg/autopar/outer-3.c: Likewise.
	* gcc.dg/autopar/outer-4.c: Likewise.
	* gcc.dg/autopar/outer-5.c: Likewise.
	* gcc.dg/autopar/outer-6.c: Likewise.
	* gcc.dg/autopar/parallelization-1.c: Likewise.
	* gcc.dg/gomp/block-3.c: Adjust for stricter #pragma omp sections
	parser.
	* gcc.dg/gomp/clause-1.c: Adjust error messages.
	* gcc.dg/gomp/combined-1.c: Look for GOMP_parallel_loop_runtime
	instead of GOMP_parallel_loop_runtime_start.
	* gcc.dg/gomp/declare-simd-1.c: New test.
	* gcc.dg/gomp/declare-simd-2.c: New test.
	* gcc.dg/gomp/nesting-1.c: Adjust for stricter #pragma omp sections
	parser.  Add further #pragma omp sections nesting tests.
	* gcc.dg/gomp/target-1.c: New test.
	* gcc.dg/gomp/target-2.c: New test.
	* gcc.dg/gomp/taskgroup-1.c: New test.
	* gcc.dg/gomp/teams-1.c: New test.
	* gcc.dg/gomp/udr-1.c: New test.
	* gcc.dg/gomp/udr-2.c: New test.
	* gcc.dg/gomp/udr-3.c: New test.
	* gcc.dg/gomp/udr-4.c: New test.
	* gfortran.dg/gomp/appendix-a/a.35.5.f90: Add dg-error.

--- gcc/testsuite/c-c++-common/gomp/atomic-15.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/c-c++-common/gomp/atomic-15.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -8,39 +8,37 @@ main ()
 {
   int v;
   #pragma omp atomic
-    x = x * 7 + 6;	/* { dg-error "expected" } */
+    x = x * 7 + 6;	/* { dg-error "expected|invalid form of" } */
   #pragma omp atomic
-    x = x * 7 ^ 6;	/* { dg-error "expected" } */
+    x = x * 7 ^ 6;	/* { dg-error "expected|invalid form of" } */
   #pragma omp atomic update
-    x = x - 8 + 6;	/* { dg-error "expected" } */
+    x = x - 8 + 6;	/* { dg-error "expected|invalid form of" } */
   #pragma omp atomic
-    x = x ^ 7 | 2;	/* { dg-error "expected" } */
+    x = x ^ 7 | 2;	/* { dg-error "expected|invalid form of" } */
   #pragma omp atomic
-    x = x / 7 * 2;	/* { dg-error "expected" } */
+    x = x / 7 * 2;	/* { dg-error "expected|invalid form of" } */
   #pragma omp atomic
-    x = x / 7 / 2;	/* { dg-error "expected" } */
+    x = x / 7 / 2;	/* { dg-error "expected|invalid form of" } */
   #pragma omp atomic capture
-    v = x = x | 6;	/* { dg-error "invalid operator" } */
+    { v = x; x = x * 7 + 6; }	/* { dg-error "expected" "" { target c++ } } */
   #pragma omp atomic capture
-    { v = x; x = x * 7 + 6; }	/* { dg-error "expected" } */
+    { v = x; x = x * 7 ^ 6; }	/* { dg-error "expected" "" { target c++ } } */
   #pragma omp atomic capture
-    { v = x; x = x * 7 ^ 6; }	/* { dg-error "expected" } */
+    { v = x; x = x - 8 + 6; }	/* { dg-error "expected" "" { target c++ } } */
   #pragma omp atomic capture
-    { v = x; x = x - 8 + 6; }	/* { dg-error "expected" } */
+    { v = x; x = x ^ 7 | 2; }	/* { dg-error "expected" "" { target c++ } } */
   #pragma omp atomic capture
-    { v = x; x = x ^ 7 | 2; }	/* { dg-error "expected" } */
+    { v = x; x = x / 7 * 2; }	/* { dg-error "expected" "" { target c++ } } */
   #pragma omp atomic capture
-    { v = x; x = x / 7 * 2; }	/* { dg-error "expected" } */
+    { v = x; x = x / 7 / 2; }	/* { dg-error "expected" "" { target c++ } } */
   #pragma omp atomic capture
-    { v = x; x = x / 7 / 2; }	/* { dg-error "expected" } */
+    { x = x * 7 + 6; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
   #pragma omp atomic capture
-    { x = x * 7 + 6; v = x; }	/* { dg-error "expected" } */
+    { x = x * 7 ^ 6; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
   #pragma omp atomic capture
-    { x = x * 7 ^ 6; v = x; }	/* { dg-error "expected" } */
+    { x = x - 8 + 6; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
   #pragma omp atomic capture
-    { x = x - 8 + 6; v = x; }	/* { dg-error "expected" } */
-  #pragma omp atomic capture
-    { x = x ^ 7 | 2; v = x; }	/* { dg-error "expected" } */
+    { x = x ^ 7 | 2; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
   (void) v;
   return 0;
 }
--- gcc/testsuite/c-c++-common/gomp/atomic-16.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/atomic-16.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+int x = 6;
+
+void
+foo ()
+{
+  int v;
+  #pragma omp atomic seq_cst load	/* { dg-error "expected end of line" } */
+  v = x;			  	/* { dg-error "invalid form" } */
+  #pragma omp atomic seq_cst, load	/* { dg-error "expected end of line" } */
+  v = x;			  	/* { dg-error "invalid form" } */
+  #pragma omp atomic seq_cst store	/* { dg-error "expected end of line" } */
+  x = v;			  	/* { dg-error "invalid form" } */
+  #pragma omp atomic seq_cst ,store	/* { dg-error "expected end of line" } */
+  x = v;			  	/* { dg-error "invalid form" } */
+  #pragma omp atomic seq_cst update	/* { dg-error "expected end of line" } */
+  x += v;
+  #pragma omp atomic seq_cst , update	/* { dg-error "expected end of line" } */
+  x += v;
+  #pragma omp atomic seq_cst capture	/* { dg-error "expected end of line" } */
+  v = x += 2;			  	/* { dg-error "invalid form" } */
+  #pragma omp atomic seq_cst, capture	/* { dg-error "expected end of line" } */
+  v = x += 2;			  	/* { dg-error "invalid form" } */
+  #pragma omp atomic load , seq_cst	/* { dg-error "expected end of line" } */
+  v = x;			  	/* { dg-error "invalid form" } */
+  #pragma omp atomic store ,seq_cst	/* { dg-error "expected end of line" } */
+  x = v;			  	/* { dg-error "invalid form" } */
+  #pragma omp atomic update, seq_cst	/* { dg-error "expected end of line" } */
+  x += v;
+  #pragma omp atomic capture, seq_cst	/* { dg-error "expected end of line" } */
+  v = x += 2;
+}
--- gcc/testsuite/c-c++-common/gomp/cancel-1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/cancel-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,396 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+f1 (void)
+{
+  #pragma omp cancel parallel			/* { dg-error "orphaned" } */
+  #pragma omp cancel for			/* { dg-error "orphaned" } */
+  #pragma omp cancel sections			/* { dg-error "orphaned" } */
+  #pragma omp cancel taskgroup			/* { dg-error "orphaned" } */
+  #pragma omp cancellation point parallel	/* { dg-error "orphaned" } */
+  #pragma omp cancellation point for		/* { dg-error "orphaned" } */
+  #pragma omp cancellation point sections	/* { dg-error "orphaned" } */
+  #pragma omp cancellation point taskgroup	/* { dg-error "orphaned" } */
+}
+
+void
+f2 (void)
+{
+  int i;
+  #pragma omp parallel
+  {
+    #pragma omp cancel parallel
+    #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 "not closely nested inside" } */
+    #pragma omp cancellation point parallel
+    #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 "not closely nested inside" } */
+    #pragma omp master
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+    #pragma omp single
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+    #pragma omp critical
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+    #pragma omp taskgroup
+    {
+      #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 "not closely nested inside" } */
+      #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 "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
+      #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
+    }
+    #pragma omp for
+    for (i = 0; i < 10; i++)
+      {
+	#pragma omp cancel parallel		/* { dg-error "not closely nested inside" } */
+	#pragma omp cancel for
+	#pragma omp cancel sections		/* { dg-error "not closely nested inside" } */
+	#pragma omp cancel taskgroup		/* { dg-error "not closely nested inside" } */
+	#pragma omp cancellation point parallel	/* { dg-error "not closely nested inside" } */
+	#pragma omp cancellation point for
+	#pragma omp cancellation point sections	/* { dg-error "not closely nested inside" } */
+	#pragma omp cancellation point taskgroup/* { dg-error "not closely nested inside" } */
+      }
+    #pragma omp for ordered
+    for (i = 0; i < 10; i++)
+      #pragma omp ordered
+      {
+	#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 "not closely nested inside" } */
+	#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 "not closely nested inside" } */
+      }
+    #pragma omp sections
+    {
+      {
+	#pragma omp cancel parallel		/* { dg-error "not closely nested inside" } */
+	#pragma omp cancel for			/* { dg-error "not closely nested inside" } */
+	#pragma omp cancel sections
+	#pragma omp cancel taskgroup		/* { dg-error "not closely nested inside" } */
+	#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
+	#pragma omp cancellation point taskgroup/* { dg-error "not closely nested inside" } */
+      }
+      #pragma omp section
+      {
+	#pragma omp cancel parallel		/* { dg-error "not closely nested inside" } */
+	#pragma omp cancel for			/* { dg-error "not closely nested inside" } */
+	#pragma omp cancel sections
+	#pragma omp cancel taskgroup		/* { dg-error "not closely nested inside" } */
+	#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
+	#pragma omp cancellation point taskgroup/* { dg-error "not closely nested inside" } */
+      }
+    }
+    #pragma omp target data
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+    #pragma omp target
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+  }
+  #pragma omp target data
+  {
+    #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 "not closely nested inside" } */
+    #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 "not closely nested inside" } */
+  }
+  #pragma omp target
+  {
+    #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 "not closely nested inside" } */
+    #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 "not closely nested inside" } */
+  }
+  #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 target teams distribute
+  for (i = 0; i < 10; i++)
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+  #pragma omp for
+  for (i = 0; i < 10; i++)
+    {
+      #pragma omp cancel parallel		/* { dg-error "not closely nested inside" } */
+      #pragma omp cancel for
+      #pragma omp cancel sections		/* { dg-error "not closely nested inside" } */
+      #pragma omp cancel taskgroup		/* { dg-error "not closely nested inside" } */
+      #pragma omp cancellation point parallel	/* { dg-error "not closely nested inside" } */
+      #pragma omp cancellation point for
+      #pragma omp cancellation point sections	/* { dg-error "not closely nested inside" } */
+      #pragma omp cancellation point taskgroup	/* { dg-error "not closely nested inside" } */
+    }
+  #pragma omp for
+  for (i = 0; i < 10; i++)
+    #pragma omp target data
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+  #pragma omp for
+  for (i = 0; i < 10; i++)
+    #pragma omp target
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+  #pragma omp for ordered
+  for (i = 0; i < 10; i++)
+    #pragma omp ordered
+      #pragma omp target data
+      {
+	#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 "not closely nested inside" } */
+	#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 "not closely nested inside" } */
+      }
+  #pragma omp for ordered
+  for (i = 0; i < 10; i++)
+    #pragma omp ordered
+      #pragma omp target
+      {
+	#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 "not closely nested inside" } */
+	#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 "not closely nested inside" } */
+      }
+  #pragma omp sections
+  {
+    {
+      #pragma omp cancel parallel		/* { dg-error "not closely nested inside" } */
+      #pragma omp cancel for			/* { dg-error "not closely nested inside" } */
+      #pragma omp cancel sections
+      #pragma omp cancel taskgroup		/* { dg-error "not closely nested inside" } */
+      #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
+      #pragma omp cancellation point taskgroup	/* { dg-error "not closely nested inside" } */
+    }
+    #pragma omp section
+    {
+      #pragma omp cancel parallel		/* { dg-error "not closely nested inside" } */
+      #pragma omp cancel for			/* { dg-error "not closely nested inside" } */
+      #pragma omp cancel sections
+      #pragma omp cancel taskgroup		/* { dg-error "not closely nested inside" } */
+      #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
+      #pragma omp cancellation point taskgroup	/* { dg-error "not closely nested inside" } */
+    }
+  }
+  #pragma omp sections
+  {
+    #pragma omp target data
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+    #pragma omp section
+    #pragma omp target data
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+  }
+  #pragma omp sections
+  {
+    #pragma omp target
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+    #pragma omp section
+    #pragma omp target
+    {
+      #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 "not closely nested inside" } */
+      #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 "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
+    #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
+    #pragma omp taskgroup
+    {
+      #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 "not closely nested inside" } */
+      #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 "not closely nested inside" } */
+    }
+  }
+}
+
+void
+f3 (void)
+{
+  int i;
+  #pragma omp for nowait
+  for (i = 0; i < 10; i++)
+    {
+      #pragma omp cancel for		/* { dg-warning "nowait" } */
+    }
+  #pragma omp sections nowait
+  {
+    {
+      #pragma omp cancel sections	/* { dg-warning "nowait" } */
+    }
+    #pragma omp section
+    {
+      #pragma omp cancel sections	/* { dg-warning "nowait" } */
+    }
+  }
+  #pragma omp for ordered
+  for (i = 0; i < 10; i++)
+    {
+      #pragma omp cancel for		/* { dg-warning "ordered" } */
+      #pragma omp ordered
+      {
+      }
+    }
+}
--- gcc/testsuite/c-c++-common/gomp/depend-1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/depend-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,79 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+extern int a[][10], a2[][10];
+int b[10], c[10][2], d[10], e[10], f[10];
+int b2[10], c2[10][2], d2[10], e2[10], f2[10];
+int k[10], l[10], m[10], n[10], o;
+int *p;
+void bar (void);
+int t[10];
+#pragma omp threadprivate (t)
+
+void
+foo (int g[3][10], int h[4][8], int i[2][10], int j[][9],
+     int g2[3][10], int h2[4][8], int i2[2][10], int j2[][9])
+{
+  #pragma omp task depend(in: bar[2:5]) /* { dg-error "is not a variable" } */
+    ;
+  #pragma omp task depend(out: t[2:5])
+    ;
+  #pragma omp task depend(inout: k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+    ;
+  #pragma omp task depend(in: l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+    ;
+  #pragma omp task depend(out: m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+    ;
+  #pragma omp task depend(inout: n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+    ;
+  #pragma omp task depend(in: o[2:5]) /* { dg-error "does not have pointer or array type" } */
+    ;
+  #pragma omp task depend(out: a[:][2:4]) /* { dg-error "array type length expression is not optional" } */
+    ;
+  #pragma omp task depend(inout: b[-1:]) /* { dg-error "negative low bound in array section" } */
+    ;
+  #pragma omp task depend(inout: c[:-3][1:1]) /* { dg-error "negative length in array section" } */
+    ;
+  #pragma omp task depend(in: d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+    ;
+  #pragma omp task depend(out: e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */
+    ;
+  #pragma omp task depend(out: f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
+    ;
+  #pragma omp task depend(in: g[:][2:4]) /* { dg-error "for pointer type length expression is not optional" } */
+    ;
+  #pragma omp task depend(in: h[2:2][-1:]) /* { dg-error "negative low bound in array section" } */
+    ;
+  #pragma omp task depend(inout: h[:1][:-3]) /* { dg-error "negative length in array section" } */
+    ;
+  #pragma omp task depend(out: i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+    ;
+  #pragma omp task depend(in: j[3:4][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */
+    ;
+  #pragma omp task depend(out: j[30:10][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
+    ;
+  #pragma omp task depend(out: a2[:3][2:4])
+    ;
+  #pragma omp task depend(inout: b2[0:])
+    ;
+  #pragma omp task depend(inout: c2[:3][1:1])
+    ;
+  #pragma omp task depend(in: d2[9:])
+    ;
+  #pragma omp task depend(out: e2[:10])
+    ;
+  #pragma omp task depend(out: f2[1:9])
+    ;
+  #pragma omp task depend(in: g2[:2][2:4])
+    ;
+  #pragma omp task depend(in: h2[2:2][0:])
+    ;
+  #pragma omp task depend(inout: h2[:1][:3])
+    ;
+  #pragma omp task depend(out: i2[:1][9:])
+    ;
+  #pragma omp task depend(in: j2[3:4][:9])
+    ;
+  #pragma omp task depend(out: j2[30:10][5:4])
+    ;
+}
--- gcc/testsuite/c-c++-common/gomp/depend-2.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/depend-2.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void bar (int a[10][10][10]);
+void
+foo (int a[10][10][10], int **b)
+{
+  int c[10][10][10];
+  #pragma omp task depend(out: a[2:4][3:][:7], b[1:7][2:8])
+    bar (a);
+  int i = 1, j = 3, k = 2, l = 6;
+  #pragma omp task depend(in: a[++i:++j][++k:][:++l])
+    bar (a);
+  #pragma omp task depend(out: a[7:2][:][:], c[5:2][:][:])
+  {
+    bar (c);
+    bar (a);
+  }
+}
--- gcc/testsuite/c-c++-common/gomp/map-1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/map-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,103 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+extern int a[][10], a2[][10];
+int b[10], c[10][2], d[10], e[10], f[10];
+int b2[10], c2[10][2], d2[10], e2[10], f2[10];
+int k[10], l[10], m[10], n[10], o;
+int *p;
+int **q;
+int r[4][4][4][4][4];
+int t[10];
+#pragma omp threadprivate (t)
+#pragma omp declare target
+void bar (int *);
+#pragma omp end declare target
+
+void
+foo (int g[3][10], int h[4][8], int i[2][10], int j[][9],
+     int g2[3][10], int h2[4][8], int i2[2][10], int j2[][9])
+{
+  #pragma omp target map(to: bar[2:5]) /* { dg-error "is not a variable" } */
+    ;
+  #pragma omp target map(from: t[2:5]) /* { dg-error "is threadprivate variable" } */
+    ;
+  #pragma omp target map(tofrom: k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+    ;
+  #pragma omp target map(from: l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+    ;
+  #pragma omp target map(to: m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+    ;
+  #pragma omp target map(tofrom: n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
+    ;
+  #pragma omp target map(to: o[2:5]) /* { dg-error "does not have pointer or array type" } */
+    ;
+  #pragma omp target map(to: a[:][:]) /* { dg-error "array type length expression is not optional" } */
+    bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" } */
+  #pragma omp target map(tofrom: b[-1:]) /* { dg-error "negative low bound in array section" } */
+    bar (b);
+  #pragma omp target map(tofrom: c[:-3][:]) /* { dg-error "negative length in array section" } */
+    bar (&c[0][0]);
+  #pragma omp target map(from: d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+    bar (d);
+  #pragma omp target map(to: e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */
+    bar (e);
+  #pragma omp target map(to: f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
+    bar (f);
+  #pragma omp target map(from: g[:][0:10]) /* { dg-error "for pointer type length expression is not optional" } */
+    bar (&g[0][0]);
+  #pragma omp target map(from: h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */
+    bar (&h[0][0]);
+  #pragma omp target map(tofrom: h[:1][:-3]) /* { dg-error "negative length in array section" } */
+    bar (&h[0][0]);
+  #pragma omp target map(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */
+    bar (&i[0][0]);
+  #pragma omp target map(from: j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */
+    bar (&j[0][0]);
+  #pragma omp target map(to: j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */
+    bar (&j[0][0]);
+  #pragma omp target map(to: a2[:1][2:4])
+    bar (&a2[0][0]);
+  #pragma omp target map(a2[3:5][:])
+    bar (&a2[0][0]);
+  #pragma omp target map(to: a2[3:5][:10])
+    bar (&a2[0][0]);
+  #pragma omp target map(tofrom: b2[0:])
+    bar (b2);
+  #pragma omp target map(tofrom: c2[:3][:])
+    bar (&c2[0][0]);
+  #pragma omp target map(from: d2[9:])
+    bar (d2);
+  #pragma omp target map(to: e2[:10])
+    bar (e2);
+  #pragma omp target map(to: f2[1:9])
+    bar (f2);
+  #pragma omp target map(g2[:1][2:4])
+    bar (&g2[0][0]);
+  #pragma omp target map(from: h2[2:2][0:])
+    bar (&h2[0][0]);
+  #pragma omp target map(tofrom: h2[:1][:3])
+    bar (&h2[0][0]);
+  #pragma omp target map(to: i2[:1][9:])
+    bar (&i2[0][0]);
+  #pragma omp target map(from: j2[3:4][:9])
+    bar (&j2[0][0]);
+  #pragma omp target map(to: j2[30:1][5:4])
+    bar (&j2[0][0]);
+  #pragma omp target map(q[1:2])
+    ;
+  #pragma omp target map(tofrom: q[3:5][:10]) /* { dg-error "array section is not contiguous" } */
+    ;
+  #pragma omp target map(r[3:][2:1][1:2])
+    ;
+  #pragma omp target map(r[3:][2:1][1:2][:][0:4])
+    ;
+  #pragma omp target map(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */
+    ;
+  #pragma omp target map(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */
+    ;
+  #pragma omp target map(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */
+    ;
+  #pragma omp target map(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */
+    ;
+}
--- gcc/testsuite/c-c++-common/gomp/pr58472.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/pr58472.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,16 @@
+/* PR tree-optimization/58472 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -fopenmp" } */
+
+float a[1024], b[1024];
+
+float
+foo ()
+{
+  float s = 0.f;
+  unsigned int i;
+#pragma omp simd reduction(+:s)
+  for (i = 0; i < 1024; ++i)
+    s += a[i] * b[i];
+  return s;
+}
--- gcc/testsuite/c-c++-common/gomp/sections1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/sections1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,73 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void bar (int);
+
+void
+foo ()
+{
+  #pragma omp sections
+  {
+    bar (1);
+    #pragma omp section
+    {
+      bar (2);
+    }
+  }
+  #pragma omp sections
+  {
+    #pragma omp section
+    bar (3);
+    #pragma omp section
+    {
+      bar (4);
+      bar (5);
+    }
+  }
+  #pragma omp sections
+  {
+    {
+      bar (6);
+      bar (7);
+    }
+    #pragma omp section
+    bar (8);
+  }
+  #pragma omp sections
+  {
+    #pragma omp section
+    {
+      bar (9);
+    }
+    #pragma omp section
+    bar (10);
+    #pragma omp section
+    bar (11);
+  }
+  #pragma omp sections
+  {
+  }				/* { dg-error "expression before" } */
+  #pragma omp sections
+  {
+    bar (12);
+    bar (13);			/* { dg-error "pragma omp section" } */
+    #pragma omp section
+    bar (14);
+  }
+  #pragma omp sections
+  {
+    #pragma omp section
+  }				/* { dg-error "expression before" } */
+  #pragma omp sections
+  {
+    bar (15);
+    #pragma omp section
+    bar (16);
+    bar (17);			/* { dg-error "pragma omp section" } */
+  }
+  #pragma omp sections
+  {
+    bar (18);
+    #pragma omp section
+  }				/* { dg-error "expression before" } */
+}
--- gcc/testsuite/c-c++-common/gomp/simd1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/simd1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+/* { dg-additional-options "-std=c99" { target c } } */
+
+extern int a[1024], b[1024], k, l, m;
+
+void
+foo ()
+{
+  int i;
+  #pragma omp simd safelen(16) aligned(a, b : 32)
+  for (i = 0; i < 1024; i++)
+    a[i] *= b[i];
+}
+
+void
+bar (int *p)
+{
+  int i;
+  #pragma omp simd safelen(16) aligned(a, p : 32) linear(k, l : m + 1)
+  for (i = 0; i < 1024; i++)
+    a[i] *= p[i], k += m + 1;
+}
+
+void
+baz (int *p)
+{
+  #pragma omp simd safelen(16) aligned(a, p : 32) linear(k, l : m + 1)
+  for (int i = 0; i < 1024; i++)
+    a[i] *= p[i], k += m + 1;
+}
--- gcc/testsuite/c-c++-common/gomp/simd2.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/simd2.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+/* { dg-additional-options "-std=c99" { target c } } */
+
+extern int a[13][13][13][13], k, l, m;
+
+void
+foo (int *q, float *p)
+{
+  int i, j, n, o;
+#pragma omp simd collapse (4) linear(k : m + 1) aligned(p, q)
+  for (i = 0; i < 13; i++)
+    for (j = 0; j < 13; j++)
+      for (n = 0; n < 13; n++)
+	for (o = 0; o < 13; o += 2)
+	  q[k] *= p[k] + 7 * i + 14 * j + 21 * n + 28 * o, k += m + 1;
+}
+
+void
+bar (float *p)
+{
+  int i, j, n, o;
+#pragma omp simd collapse (4) linear(k : m + 1)
+  for (i = 0; i < 13; i++)
+    for (j = 0; j < 13; j++)
+      for (n = 0; n < 13; n++)
+	for (o = 0; o < 13; o += 2)
+	  a[i][j][n][o] *= p[k], k += m + 1;
+}
--- gcc/testsuite/c-c++-common/gomp/simd3.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/simd3.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+/* { dg-additional-options "-std=c99" { target c } } */
+
+extern int a[13*13*13*13*2], b[1024], *k, l, m;
+
+void
+foo (int *q, float *p)
+{
+  int *i, *j, *n, *o;
+#pragma omp simd collapse (4) linear(k : m + 1) aligned(p, q)
+  for (i = &a[0]; i < &a[13*13*13*13*2]; i += 13*13*13*2)
+    for (j = &a[0]; j < &a[13*13*13*2]; j += 13*13*2)
+      for (n = &a[0]; n < &a[13*13*2]; n += 13*2)
+	for (o = &a[0]; o < &a[13*2]; o += 2)
+	  q[k - &a[0]] *= p[k - &a[0]] + 7 * (i-&a[0]) + 14 * (j-&a[0]) + 21 * (n-&a[0]) + 28 * (o-&a[0]), k += m + 1;
+}
+
+void
+bar ()
+{
+  int *i;
+  #pragma omp simd safelen(16) aligned(a, b : 32)
+  for (i = &a[0]; i < &a[1024]; i++)
+    *i *= b[i - &a[0]];
+}
--- gcc/testsuite/c-c++-common/gomp/simd4.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/simd4.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+/* { dg-additional-options "-std=c99" { target c } } */
+
+struct S *p;	/* { dg-error "forward declaration" "" { target c++ } } */
+float f;
+int j;
+
+void
+foo (void)
+{
+#pragma omp simd linear(p) linear(f : 1)
+  for (int i = 0; i < 10; i++)
+    ;
+#pragma omp simd linear(j : 7.0)	/* { dg-error "step expression must be integral" } */
+  for (int i = 0; i < 10; i++)
+    ;
+}
+
+/* { dg-error "linear clause applied to" "" { target *-*-* } 12 } */
+/* { dg-error "(incomplete|undefined) type" "" { target *-*-* } 12 } */
--- gcc/testsuite/c-c++-common/gomp/simd5.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/simd5.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+/* { dg-additional-options "-std=c99" { target c } } */
+
+void baz (void) __attribute__((noreturn));
+
+void
+foo (int x)
+{
+  if (x)
+  #pragma omp simd
+    for (int i = 0; i < 10; i++)
+      baz ();
+#pragma omp simd collapse(3)
+  for (int i = 0; i < 10; i++)
+    for (int j = 0; j < 10; j++)
+      for (int k = 0; k < 10; k++)
+	baz ();
+}
--- gcc/testsuite/c-c++-common/gomp/single1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/c-c++-common/gomp/single1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+foo (int i)
+{
+  #pragma omp single copyprivate (i)
+    ;
+  #pragma omp single nowait
+    ;
+  #pragma omp single copyprivate (i) nowait	/* { dg-error "clause must not be used together with" } */
+    ;
+  #pragma omp single nowait copyprivate (i)	/* { dg-error "clause must not be used together with" } */
+    ;
+}
--- gcc/testsuite/g++.dg/gomp/block-0.C	(.../trunk)	(revision 203241)
+++ gcc/testsuite/g++.dg/gomp/block-0.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -22,8 +22,10 @@ void foo()
     bar ();
   #pragma omp parallel sections
     {
-      bar ();
-      bar ();
+      {
+	bar ();
+	bar ();
+      }
     #pragma omp section
       bar ();
     }
--- gcc/testsuite/g++.dg/gomp/block-3.C	(.../trunk)	(revision 203241)
+++ gcc/testsuite/g++.dg/gomp/block-3.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -35,8 +35,10 @@ void foo()
 
   #pragma omp sections
     {
-      goto ok1;
-      ok1:;
+      {
+	goto ok1;
+	ok1:;
+      }
 
     #pragma omp section
       for (i = 0; i < 10; ++i)
--- gcc/testsuite/g++.dg/gomp/clause-3.C	(.../trunk)	(revision 203241)
+++ gcc/testsuite/g++.dg/gomp/clause-3.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -11,7 +11,7 @@ int t;
 void
 foo (int x)
 {
-  char *p;
+  char *pp;
   struct S { int i; int j; } s;
   char a[32];
   double d;
@@ -42,18 +42,18 @@ foo (int x)
     ;
 #pragma omp p firstprivate (bar) // { dg-error "is not a variable" }
     ;
-#pragma omp p reduction (+:p) // { dg-error "has invalid type for" }
+#pragma omp p reduction (+:pp) // { dg-error "user defined reduction not found for" }
     ;
-#pragma omp p reduction (*:s) // { dg-error "has invalid type for" }
+#pragma omp p reduction (*:s) // { dg-error "user defined reduction not found for" }
     ;
 #pragma omp p reduction (-:a) // { dg-error "has invalid type for" }
     ;
   d = 0;
 #pragma omp p reduction (*:d)
     ;
-#pragma omp p reduction (|:d) // { dg-error "has invalid type for" }
+#pragma omp p reduction (|:d) // { dg-error "user defined reduction not found for" }
     ;
-#pragma omp p reduction (&&:d) // { dg-error "has invalid type for" }
+#pragma omp p reduction (&&:d) // { dg-error "user defined reduction not found for" }
     ;
 #pragma omp p copyin (d) // { dg-error "must be 'threadprivate'" }
     ;
--- gcc/testsuite/g++.dg/gomp/declare-simd-1.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/declare-simd-1.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,243 @@
+// Test parsing of #pragma omp declare simd
+// { dg-do compile }
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) \
+	    linear (c : 4) simdlen (8) notinbranch
+#pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a \
+									    : 4) simdlen (4) inbranch
+int f1 (int a, int *b, int c);
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int f2 (int a, int *b, int c)
+{
+  return a + *b + c;
+}
+
+#pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) simdlen (4)
+template <typename T>
+T f3 (int a, int *b, T c);
+
+template <>
+int f3 (int, int *, int);
+
+#pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) notinbranch simdlen (4)
+template <typename T>
+int f4 (int a, int *b, T c)
+{
+  return a + *b + c;
+}
+
+template <>
+int f4 (int, int *, int);
+
+template <typename T>
+int f5 (int a, int *b, T c);
+
+#pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) simdlen (4)
+template <>
+int f5 (int a, int *b, int c);
+
+template <int N>
+int f6 (int a, int *b, int c);
+
+#pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) inbranch simdlen (4)
+template <>
+int f6<3> (int a, int *b, int c);
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (long long)) linear (c : 4) simdlen (8)
+__extension__
+long long f7 (long long a, long long *b, long long c);
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) notinbranch simdlen (8)
+extern "C"
+int f8 (int a, int *b, int c);
+
+extern "C"
+{
+  #pragma omp declare simd
+  int f9 (int a, int *b, int c);
+}
+
+namespace N1
+{
+  namespace N2
+  {
+    #pragma omp declare simd simdlen (2) aligned (b : sizeof (long long) * 2)
+    __extension__ long long
+    f10 (long long *b)
+    {
+      return *b;
+    }
+  }
+}
+
+struct A
+{
+  #pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+  #pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) simdlen (4)
+  int f11 (int a, int *b, int c);
+
+  #pragma omp declare simd
+  template <int N>
+  int f12 (int a, int *b, int c);
+
+  #pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) notinbranch simdlen (8)
+  #pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) simdlen (4) inbranch
+  static int f13 (int a, int *b, int c);
+
+  #pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+  #pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) simdlen (4)
+  int f14 (int a, int *b, int c) { return a + *b + c; }
+
+  #pragma omp declare simd
+  template <int N>
+  int f15 (int a, int *b, int c) { return a + *b + c; }
+
+  #pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+  #pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) simdlen (4)
+  static int f16 (int a, int *b, int c) { return a + *b + c; }
+};
+
+template <>
+int A::f12<2> (int, int *, int);
+
+template <>
+int A::f15<2> (int, int *, int);
+
+template <typename T>
+struct B
+{
+  #pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8) notinbranch
+  #pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) simdlen (4) inbranch
+  int f17 (int a, int *b, int c);
+
+  #pragma omp declare simd
+  template <int N>
+  int f18 (int a, int *b, int c);
+
+  #pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+  #pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) simdlen (4)
+  static int f19 (int a, int *b, int c);
+
+  #pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+  #pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) simdlen (4)
+  int f20 (int a, int *b, int c) { return a + *b + c; }
+
+  #pragma omp declare simd
+  template <int N>
+  int f21 (int a, int *b, int c) { return a + *b + c; }
+
+  #pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+  #pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a : 4) simdlen (4)
+  static int f22 (int a, int *b, int c) { return a + *b + c; }
+
+  template <int N>
+  int f23 (int, int *, int);
+
+  template <int N>
+  static int f24 (int, int *, int);
+
+  template <int N>
+  int f25 (int, int *, int);
+
+  template <int N>
+  static int f26 (int, int *, int);
+};
+
+B <int> b;
+
+template <>
+template <>
+int B<int>::f18<0> (int, int *, int);
+
+template <>
+template <>
+int B<int>::f21<9> (int, int *, int);
+
+#pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int)) uniform (a, c)
+template <>
+template <>
+int B<int>::f23<7> (int a, int *b, int c);
+
+#pragma omp declare simd simdlen (4) aligned (b : 8 * sizeof (int)) linear (a, c : 2)
+template <>
+template <>
+int B<int>::f24<-1> (int a, int *b, int c);
+
+#pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int)) uniform (a, c)
+template <>
+template <>
+int B<int>::f25<7> (int a, int *b, int c)
+{
+  return a + *b + c;
+}
+
+#pragma omp declare simd simdlen (4) aligned (b : 8 * sizeof (int)) linear (a, c : 2)
+template <>
+template <>
+int B<int>::f26<-1> (int a, int *b, int c)
+{
+  return a + *b + c;
+}
+
+int
+f27 (int x)
+{
+  #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+  extern int f28 (int a, int *b, int c);
+  {
+    x++;
+    #pragma omp declare simd simdlen (4) linear (c)
+    extern int f29 (int a, int *b, int c);
+  }
+  return x;
+}
+
+#pragma omp declare simd simdlen (16)
+int
+f30 (int x)
+{
+  #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+  extern int f31 (int a, int *b, int c);
+  return x;
+}
+
+template <int N>
+struct C
+{
+  #pragma omp declare simd simdlen (N) aligned (a : N * sizeof (int)) linear (c : N) notinbranch
+  int f32 (int a, int *b, int c);
+};
+
+C <2> c;
+
+int
+f33 (int x)
+{
+  if (x)
+    #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+    extern int f34 (int a, int *b, int c);
+  while (x < 10)
+    #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+    extern int f35 (int a, int *b, int c);
+  return x;
+}
+
+#pragma omp declare simd simdlen (N)
+template <int N>
+int f36 (int);
+
+struct D
+{
+  int d;
+  #pragma omp declare simd simdlen (N) linear (a : sizeof (a) + sizeof (d) + sizeof (this) + sizeof (this->d))
+  template <int N>
+  int f37 (int a);
+  int e;
+};
+
+void
+f38 (D &d)
+{
+  d.f37 <12> (6);
+}
--- gcc/testsuite/g++.dg/gomp/declare-simd-2.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/declare-simd-2.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,67 @@
+// Test parsing of #pragma omp declare simd
+// { dg-do compile }
+
+#pragma omp declare simd
+int a;	// { dg-error "not immediately followed by function declaration or definition" }
+
+#pragma omp declare simd
+int fn1 (int a), fn2 (int a);	// { dg-error "not immediately followed by a single function declaration or definition" }
+
+#pragma omp declare simd
+int b, fn3 (int a);	// { dg-error "not immediately followed by function declaration or definition" }
+
+#pragma omp declare simd linear (a)
+int fn4 (int a), c;	// { dg-error "not immediately followed by function declaration or definition" }
+
+#pragma omp declare simd
+extern "C"		// { dg-error "not immediately followed by function declaration or definition" }
+{
+  int fn5 (int a);
+}
+
+#pragma omp declare simd // { dg-error "not immediately followed by function declaration or definition" }
+namespace N1
+{
+  int fn6 (int a);
+}
+
+#pragma omp declare simd simdlen (4)
+struct A
+{			// { dg-error "not immediately followed by function declaration or definition" }
+  int fn7 (int a);
+};
+
+#pragma omp declare simd
+template <typename T>
+struct B
+{			// { dg-error "not immediately followed by function declaration or definition" }
+  int fn8 (int a);
+};
+
+struct C
+{
+#pragma omp declare simd // { dg-error "not immediately followed by function declaration or definition" }
+  public:		 // { dg-error "expected unqualified-id before" }
+    int fn9 (int a);
+};
+
+int t;
+
+#pragma omp declare simd
+#pragma omp declare simd
+#pragma omp threadprivate(t)	// { dg-error "not immediately followed by function declaration or definition" }
+int fn10 (int a);
+
+#pragma omp declare simd inbranch notinbranch // { dg-error "clause is incompatible with" }
+int fn11 (int);
+
+struct D
+{
+  int d;
+  #pragma omp declare simd simdlen (N) linear (a : sizeof (e) + sizeof (this->e)) // { dg-error "was not declared" }
+  template <int N>
+  int fn12 (int a);
+  int e;
+};
+
+// { dg-error "has no member" "" { target *-*-* } 61 }
--- gcc/testsuite/g++.dg/gomp/depend-1.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/depend-1.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,70 @@
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+extern int a[][10], a2[][10];
+int b[10], c[10][2], d[10], e[10], f[10];
+int b2[10], c2[10][2], d2[10], e2[10], f2[10];
+int k[10], l[10], m[10], n[10], o;
+int *p;
+void bar (void);
+int t[10];
+#pragma omp threadprivate (t)
+
+template <int N>
+void
+foo (int g[3][10], int h[4][8], int i[2][10], int j[][9],
+     int g2[3][10], int h2[4][8], int i2[2][10], int j2[][9])
+{
+  #pragma omp task depend(out: t[2:5])
+    ;
+  #pragma omp task depend(inout: k[0.5:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
+    ;
+  #pragma omp task depend(in: l[:7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
+    ;
+  #pragma omp task depend(out: m[p:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
+    ;
+  #pragma omp task depend(inout: n[:p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
+    ;
+  #pragma omp task depend(in: o[2:5]) // { dg-error "does not have pointer or array type" }
+    ;
+  #pragma omp task depend(out: a[:][2:4]) // { dg-error "array type length expression is not optional" }
+    ;
+  #pragma omp task depend(in: d[11:]) // { dg-error "low bound \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(out: e[:11]) // { dg-error "length \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(out: f[1:10]) // { dg-error "high bound \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(in: g[:][2:4]) // { dg-error "for pointer type length expression is not optional" }
+    ;
+  #pragma omp task depend(out: i[:1][11:]) // { dg-error "low bound \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(in: j[3:4][:10]) // { dg-error "length \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(out: j[30:10][5:5]) // { dg-error "high bound \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(out: a2[:3][2:4])
+    ;
+  #pragma omp task depend(inout: b2[0:])
+    ;
+  #pragma omp task depend(inout: c2[:3][1:1])
+    ;
+  #pragma omp task depend(in: d2[9:])
+    ;
+  #pragma omp task depend(out: e2[:10])
+    ;
+  #pragma omp task depend(out: f2[1:9])
+    ;
+  #pragma omp task depend(in: g2[:2][2:4])
+    ;
+  #pragma omp task depend(in: h2[2:2][0:])
+    ;
+  #pragma omp task depend(inout: h2[:1][:3])
+    ;
+  #pragma omp task depend(out: i2[:1][9:])
+    ;
+  #pragma omp task depend(in: j2[3:4][:9])
+    ;
+  #pragma omp task depend(out: j2[30:10][5:4])
+    ;
+}
--- gcc/testsuite/g++.dg/gomp/depend-2.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/depend-2.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,87 @@
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+extern int a[][10], a2[][10];
+int b[10], c[10][2], d[10], e[10], f[10];
+int b2[10], c2[10][2], d2[10], e2[10], f2[10];
+int k[10], l[10], m[10], n[10], o;
+int *p;
+void bar (void);
+int t[10];
+#pragma omp threadprivate (t)
+
+template <int N>
+void
+foo (int g[3][10], int h[4][8], int i[2][10], int j[][9],
+     int g2[3][10], int h2[4][8], int i2[2][10], int j2[][9])
+{
+  #pragma omp task depend(in: bar[2:5]) // { dg-error "is not a variable" }
+    ;
+  #pragma omp task depend(out: t[2:5])
+    ;
+  #pragma omp task depend(inout: k[0.5:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
+    ;
+  #pragma omp task depend(in: l[:7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
+    ;
+  #pragma omp task depend(out: m[p:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
+    ;
+  #pragma omp task depend(inout: n[:p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
+    ;
+  #pragma omp task depend(in: o[2:5]) // { dg-error "does not have pointer or array type" }
+    ;
+  #pragma omp task depend(out: a[:][2:4]) // { dg-error "array type length expression is not optional" }
+    ;
+  #pragma omp task depend(inout: b[-1:]) // { dg-error "negative low bound in array section" }
+    ;
+  #pragma omp task depend(inout: c[:-3][1:1]) // { dg-error "negative length in array section" }
+    ;
+  #pragma omp task depend(in: d[11:]) // { dg-error "low bound \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(out: e[:11]) // { dg-error "length \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(out: f[1:10]) // { dg-error "high bound \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(in: g[:][2:4]) // { dg-error "for pointer type length expression is not optional" }
+    ;
+  #pragma omp task depend(in: h[2:2][-1:]) // { dg-error "negative low bound in array section" }
+    ;
+  #pragma omp task depend(inout: h[:1][:-3]) // { dg-error "negative length in array section" }
+    ;
+  #pragma omp task depend(out: i[:1][11:]) // { dg-error "low bound \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(in: j[3:4][:10]) // { dg-error "length \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(out: j[30:10][5:5]) // { dg-error "high bound \[^\n\r]* above array section size" }
+    ;
+  #pragma omp task depend(out: a2[:3][2:4])
+    ;
+  #pragma omp task depend(inout: b2[0:])
+    ;
+  #pragma omp task depend(inout: c2[:3][1:1])
+    ;
+  #pragma omp task depend(in: d2[9:])
+    ;
+  #pragma omp task depend(out: e2[:10])
+    ;
+  #pragma omp task depend(out: f2[1:9])
+    ;
+  #pragma omp task depend(in: g2[:2][2:4])
+    ;
+  #pragma omp task depend(in: h2[2:2][0:])
+    ;
+  #pragma omp task depend(inout: h2[:1][:3])
+    ;
+  #pragma omp task depend(out: i2[:1][9:])
+    ;
+  #pragma omp task depend(in: j2[3:4][:9])
+    ;
+  #pragma omp task depend(out: j2[30:10][5:4])
+    ;
+}
+
+void
+baz (int g[3][10], int h[4][8], int i[2][10], int j[][9],
+     int g2[3][10], int h2[4][8], int i2[2][10], int j2[][9])
+{
+  foo<0> (g, h, i, j, g2, h2, i2, j2);
+}
--- gcc/testsuite/g++.dg/gomp/target-1.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/target-1.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,32 @@
+// { dg-do compile }
+
+void
+foo (int x)
+{
+  bad1:				// { dg-error "jump to label" }
+  #pragma omp target
+    goto bad1;			// { dg-error "from here|exits OpenMP" }
+
+  goto bad2;			// { dg-error "from here" }
+  #pragma omp target
+    {
+      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+    }
+
+  #pragma omp target
+    {
+      int i;
+      goto ok1;
+      for (i = 0; i < 10; ++i)
+	{ ok1: break; }
+    }
+
+  switch (x)
+  {
+  #pragma omp target
+    { case 0:; }		// { dg-error "jump|enters" }
+  }
+}
+
+// { dg-error "invalid branch to/from an OpenMP structured block" "" { target *-*-* } 8 }
+// { dg-error "invalid entry to OpenMP structured block" "" { target *-*-* } 10 }
--- gcc/testsuite/g++.dg/gomp/target-2.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/target-2.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,32 @@
+// { dg-do compile }
+
+void
+foo (int x, int y)
+{
+  bad1:				// { dg-error "jump to label" }
+  #pragma omp target data map(tofrom: y)
+    goto bad1;			// { dg-error "from here|exits OpenMP" }
+
+  goto bad2;			// { dg-error "from here" }
+  #pragma omp target data map(tofrom: y)
+    {
+      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+    }
+
+  #pragma omp target data map(tofrom: y)
+    {
+      int i;
+      goto ok1;
+      for (i = 0; i < 10; ++i)
+	{ ok1: break; }
+    }
+
+  switch (x)
+  {
+  #pragma omp target data map(tofrom: y)
+    { case 0:; }		// { dg-error "jump|enters" }
+  }
+}
+
+// { dg-error "invalid branch to/from an OpenMP structured block" "" { target *-*-* } 8 }
+// { dg-error "invalid entry to OpenMP structured block" "" { target *-*-* } 10 }
--- gcc/testsuite/g++.dg/gomp/taskgroup-1.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/taskgroup-1.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,32 @@
+// { dg-do compile }
+
+void
+foo (int x)
+{
+  bad1:				// { dg-error "jump to label" }
+  #pragma omp taskgroup
+    goto bad1;			// { dg-error "from here|exits OpenMP" }
+
+  goto bad2;			// { dg-error "from here" }
+  #pragma omp taskgroup
+    {
+      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+    }
+
+  #pragma omp taskgroup
+    {
+      int i;
+      goto ok1;
+      for (i = 0; i < 10; ++i)
+	{ ok1: break; }
+    }
+
+  switch (x)
+  {
+  #pragma omp taskgroup
+    { case 0:; }		// { dg-error "jump|enters" }
+  }
+}
+
+// { dg-error "invalid branch to/from an OpenMP structured block" "" { target *-*-* } 8 }
+// { dg-error "invalid entry to OpenMP structured block" "" { target *-*-* } 10 }
--- gcc/testsuite/g++.dg/gomp/teams-1.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/teams-1.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,66 @@
+// { dg-do compile }
+
+void
+foo (int x)
+{
+  bad1:				// { dg-error "jump to label" }
+  #pragma omp target teams
+    goto bad1;			// { dg-error "from here|exits OpenMP" }
+
+  goto bad2;			// { dg-error "from here" }
+  #pragma omp target teams
+    {
+      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+    }
+
+  #pragma omp target teams
+    {
+      int i;
+      goto ok1;
+      for (i = 0; i < 10; ++i)
+	{ ok1: break; }
+    }
+
+  switch (x)
+  {
+  #pragma omp target teams
+    { case 0:; }		// { dg-error "jump|enters" }
+  }
+}
+
+void
+bar (int x)
+{
+  bad1:				// { dg-error "jump to label" }
+  #pragma omp target
+  #pragma omp teams
+    goto bad1;			// { dg-error "from here|exits OpenMP" }
+
+  goto bad2;			// { dg-error "from here" }
+  #pragma omp target
+  #pragma omp teams
+    {
+      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+    }
+
+  #pragma omp target
+  #pragma omp teams
+    {
+      int i;
+      goto ok1;
+      for (i = 0; i < 10; ++i)
+	{ ok1: break; }
+    }
+
+  switch (x)
+  {
+  #pragma omp target
+  #pragma omp teams
+    { case 0:; }		// { dg-error "jump|enters" }
+  }
+}
+
+// { dg-error "invalid branch to/from an OpenMP structured block" "" { target *-*-* } 8 }
+// { dg-error "invalid entry to OpenMP structured block" "" { target *-*-* } 10 }
+// { dg-error "invalid branch to/from an OpenMP structured block" "" { target *-*-* } 37 }
+// { dg-error "invalid entry to OpenMP structured block" "" { target *-*-* } 39 }
--- gcc/testsuite/g++.dg/gomp/udr-1.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/udr-1.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,119 @@
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+namespace N1
+{
+  #pragma omp declare reduction (| : long int : omp_out |= omp_in)	// { dg-error "predeclared arithmetic type" }
+  #pragma omp declare reduction (+ : char : omp_out += omp_in)		// { dg-error "predeclared arithmetic type" }
+  typedef short T;
+  #pragma omp declare reduction (min : T : omp_out += omp_in)		// { dg-error "predeclared arithmetic type" }
+  #pragma omp declare reduction (* : _Complex double : omp_out *= omp_in)// { dg-error "predeclared arithmetic type" }
+}
+namespace N2
+{
+  template <typename T1, typename T2, typename T3, typename T4>
+  struct S
+  {
+    #pragma omp declare reduction (| : T1 : omp_out |= omp_in)		// { dg-error "predeclared arithmetic type" }
+    #pragma omp declare reduction (+ : T2 : omp_out += omp_in)		// { dg-error "predeclared arithmetic type" }
+    typedef T3 T;
+    #pragma omp declare reduction (min : T : omp_out += omp_in)		// { dg-error "predeclared arithmetic type" }
+    #pragma omp declare reduction (* : T4 : omp_out *= omp_in)		// { dg-error "predeclared arithmetic type" }
+  };
+  S<long int, char, short, _Complex double> s;
+  template <typename T1, typename T2, typename T3, typename T4>
+  int foo ()
+  {
+    #pragma omp declare reduction (| : T1 : omp_out |= omp_in)		// { dg-error "predeclared arithmetic type" }
+    #pragma omp declare reduction (+ : T2 : omp_out += omp_in)		// { dg-error "predeclared arithmetic type" }
+    typedef T3 T;
+    #pragma omp declare reduction (min : T : omp_out += omp_in)		// { dg-error "predeclared arithmetic type" }
+    #pragma omp declare reduction (* : T4 : omp_out *= omp_in)		// { dg-error "predeclared arithmetic type" }
+    return 0;
+  }
+  int x = foo <long int, char, short, _Complex double> ();
+}
+namespace N3
+{
+  void bar ();
+  #pragma omp declare reduction (| : __typeof (bar) : omp_out |= omp_in)// { dg-error "function or array type" }
+  #pragma omp declare reduction (+ : char () : omp_out += omp_in)	// { dg-error "function or array type" }
+  typedef short T;
+  #pragma omp declare reduction (min : T[2] : omp_out += omp_in)	// { dg-error "function or array type" }
+  #pragma omp declare reduction (baz : char & : omp_out *= omp_in)	// { dg-error "reference type" }
+}
+namespace N4
+{
+  void bar ();
+  template <typename T1, typename T2, typename T3, typename T4>
+  struct S
+  {
+    #pragma omp declare reduction (| : T1 : omp_out |= omp_in)		// { dg-error "function or array type" }
+    #pragma omp declare reduction (+ : T2 : omp_out += omp_in)		// { dg-error "function or array type" }
+    typedef T3 T;
+    #pragma omp declare reduction (min : T : omp_out += omp_in)		// { dg-error "function or array type" }
+    #pragma omp declare reduction (baz : T4 : omp_out *= omp_in)	// { dg-error "function or array type" }
+  };
+  S<__typeof (bar), char (), short [3], char []> s;
+  template <typename T1, typename T2, typename T3, typename T4>
+  int foo ()
+  {
+    #pragma omp declare reduction (| : T1 : omp_out |= omp_in)		// { dg-error "function or array type" }
+    #pragma omp declare reduction (+ : T2 : omp_out += omp_in)		// { dg-error "function or array type" }
+    typedef T3 T;
+    #pragma omp declare reduction (min : T : omp_out += omp_in)		// { dg-error "function or array type" }
+    #pragma omp declare reduction (baz : T4 : omp_out *= omp_in)	// { dg-error "function or array type" }
+    return 0;
+  }
+  int x = foo <__typeof (bar), char (), short[], char [2]> ();
+}
+namespace N5
+{
+  template <typename T>
+  struct S
+  {
+    #pragma omp declare reduction (baz : T : omp_out *= omp_in)		// { dg-error "reference type" }
+  };
+  S<char &> s;
+  template <typename T>
+  int foo ()
+  {
+    #pragma omp declare reduction (baz : T : omp_out *= omp_in)		// { dg-error "reference type" }
+    return 0;
+  }
+  int x = foo <char &> ();
+}
+namespace N6
+{
+  struct A { int a; A () : a (0) {} };
+  #pragma omp declare reduction (| : const A : omp_out.a |= omp_in.a)	// { dg-error "const, volatile or __restrict" }
+  #pragma omp declare reduction (+ : __const A : omp_out.a += omp_in.a)	// { dg-error "const, volatile or __restrict" }
+  typedef volatile A T;
+  #pragma omp declare reduction (min : T : omp_out.a += omp_in.a)	// { dg-error "const, volatile or __restrict" }
+  #pragma omp declare reduction (* : A *__restrict : omp_out->a *= omp_in->a)// { dg-error "const, volatile or __restrict" }
+}
+namespace N7
+{
+  struct A { int a; A () : a (0) {} };
+  template <typename T1, typename T2, typename T3, typename T4>
+  struct S
+  {
+    #pragma omp declare reduction (| : T1 : omp_out |= omp_in)		// { dg-error "const, volatile or __restrict" }
+    #pragma omp declare reduction (+ : T2 : omp_out += omp_in)		// { dg-error "const, volatile or __restrict" }
+    typedef T3 T;
+    #pragma omp declare reduction (min : T : omp_out += omp_in)		// { dg-error "const, volatile or __restrict" }
+    #pragma omp declare reduction (* : T4 : omp_out *= omp_in)		// { dg-error "const, volatile or __restrict" }
+  };
+  S<const A, __const A, volatile A, A *__restrict> s;
+  template <typename T1, typename T2, typename T3, typename T4>
+  int foo ()
+  {
+    #pragma omp declare reduction (| : T1 : omp_out |= omp_in)		// { dg-error "const, volatile or __restrict" }
+    #pragma omp declare reduction (+ : T2 : omp_out += omp_in)		// { dg-error "const, volatile or __restrict" }
+    typedef T3 T;
+    #pragma omp declare reduction (min : T : omp_out += omp_in)		// { dg-error "const, volatile or __restrict" }
+    #pragma omp declare reduction (* : T4 : omp_out *= omp_in)		// { dg-error "const, volatile or __restrict" }
+    return 0;
+  }
+  int x = foo <const A, __const A, volatile A, A *__restrict> ();
+}
--- gcc/testsuite/g++.dg/gomp/udr-2.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/udr-2.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,119 @@
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+struct W { int w; W () : w (0) {} W (int x) : w (x) {} };
+namespace N1
+{
+  int v;
+  #pragma omp declare reduction (foo : long int : omp_out |= v)	// { dg-error "combiner refers to variable" }
+  #pragma omp declare reduction (foo : char : omp_out = v)	// { dg-error "combiner refers to variable" }
+  typedef short T;
+  #pragma omp declare reduction (foo : T : omp_out += N1::v)	// { dg-error "combiner refers to variable" }
+  #pragma omp declare reduction (foo : int : v *= omp_in)	// { dg-error "combiner refers to variable" }
+  #pragma omp declare reduction (foo : W : omp_out.w *= omp_in.w + v) // { dg-error "combiner refers to variable" }
+}
+namespace N2
+{
+  int v;
+  template <typename T1, typename T2, typename T3, typename T4, typename T5>
+  struct S
+  {
+    #pragma omp declare reduction (foo : T1 : omp_out |= v)	// { dg-error "combiner refers to variable" }
+    #pragma omp declare reduction (foo : T2 : omp_out = v)	// { dg-error "combiner refers to variable" }
+    typedef T3 T;
+    #pragma omp declare reduction (foo : T : omp_out += N1::v)	// { dg-error "combiner refers to variable" }
+    #pragma omp declare reduction (foo : T4 : v *= omp_in)	// { dg-error "combiner refers to variable" }
+    #pragma omp declare reduction (foo : T5 : omp_out.w *= omp_in.w + v) // { dg-error "combiner refers to variable" }
+  };
+  S<long int, char, short, _Complex double, W> s;
+  template <typename T1, typename T2, typename T3, typename T4, typename T5>
+  int foo ()
+  {
+    #pragma omp declare reduction (foo : T1 : omp_out |= v)	// { dg-error "combiner refers to variable" }
+    #pragma omp declare reduction (foo : T2 : omp_out = v)	// { dg-error "combiner refers to variable" }
+    typedef T3 T;
+    #pragma omp declare reduction (foo : T : omp_out += N1::v)	// { dg-error "combiner refers to variable" }
+    #pragma omp declare reduction (foo : T4 : v *= omp_in)	// { dg-error "combiner refers to variable" }
+    #pragma omp declare reduction (foo : T5 : omp_out.w *= omp_in.w + v) // { dg-error "combiner refers to variable" }
+    return 0;
+  }
+  int x = foo <long int, char, short, _Complex double, W> ();
+}
+namespace N3
+{
+  int v;
+  #pragma omp declare reduction (foo : long int : omp_out |= omp_in) initializer (omp_priv = v) // { dg-error "initializer refers to variable" }
+  #pragma omp declare reduction (foo : char : omp_out += omp_in) initializer (omp_priv ((char) N3::v)) // { dg-error "initializer refers to variable" }
+  typedef short T;
+  #pragma omp declare reduction (foo : T : omp_out += omp_in) initializer (omp_priv = (short) v) // { dg-error "initializer refers to variable" }
+  #pragma omp declare reduction (foo : _Complex double : omp_out *= omp_in) initializer (omp_priv (v)) // { dg-error "initializer refers to variable" }
+  #pragma omp declare reduction (foo : W : omp_out.w *= omp_in.w) initializer (omp_priv (N3::v)) // { dg-error "initializer refers to variable" }
+}
+namespace N4
+{
+  int v;
+  template <typename T1, typename T2, typename T3, typename T4, typename T5>
+  struct S
+  {
+    #pragma omp declare reduction (foo : T1 : omp_out |= omp_in) initializer (omp_priv = v) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T2 : omp_out += omp_in) initializer (omp_priv ((char) N3::v)) // { dg-error "initializer refers to variable" }
+    typedef T3 T;
+    #pragma omp declare reduction (foo : T : omp_out += omp_in) initializer (omp_priv = (short) v) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T4 : omp_out *= omp_in) initializer (omp_priv (v)) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T5 : omp_out.w *= omp_in.w) initializer (omp_priv (N3::v)) // { dg-error "initializer refers to variable" }
+  };
+  S<long int, char, short, _Complex double, W> s;
+  template <typename T1, typename T2, typename T3, typename T4, typename T5>
+  int foo ()
+  {
+    #pragma omp declare reduction (foo : T1 : omp_out |= omp_in) initializer (omp_priv = v) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T2 : omp_out += omp_in) initializer (omp_priv ((char) N3::v)) // { dg-error "initializer refers to variable" }
+    typedef T3 T;
+    #pragma omp declare reduction (foo : T : omp_out += omp_in) initializer (omp_priv = (short) v) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T4 : omp_out *= omp_in) initializer (omp_priv (v)) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T5 : omp_out.w *= omp_in.w) initializer (omp_priv (N3::v)) // { dg-error "initializer refers to variable" }
+    return 0;
+  }
+  int x = foo <long int, char, short, _Complex double, W> ();
+}
+template <typename T>
+void init (T &, int &);
+template <typename T>
+void initializer (T, int &);
+namespace N5
+{
+  int v;
+  #pragma omp declare reduction (foo : long int : omp_out |= omp_in) initializer (init (omp_priv, v)) // { dg-error "initializer refers to variable" }
+  #pragma omp declare reduction (foo : char : omp_out += omp_in) initializer (initializer (&omp_priv, N3::v)) // { dg-error "initializer refers to variable" }
+  typedef short T;
+  #pragma omp declare reduction (foo : T : omp_out += omp_in) initializer (init (omp_priv, v)) // { dg-error "initializer refers to variable" }
+  #pragma omp declare reduction (foo : _Complex double : omp_out *= omp_in) initializer (initializer (&omp_priv, v)) // { dg-error "initializer refers to variable" }
+  #pragma omp declare reduction (foo : W : omp_out.w *= omp_in.w) initializer (init (omp_priv, N3::v)) // { dg-error "initializer refers to variable" }
+}
+namespace N6
+{
+  int v;
+  template <typename T1, typename T2, typename T3, typename T4, typename T5>
+  struct S
+  {
+    #pragma omp declare reduction (foo : T1 : omp_out |= omp_in) initializer (initializer (&omp_priv, v)) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T2 : omp_out += omp_in) initializer (init (omp_priv, N3::v)) // { dg-error "initializer refers to variable" }
+    typedef T3 T;
+    #pragma omp declare reduction (foo : T : omp_out += omp_in) initializer (init (omp_priv, v)) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T4 : omp_out *= omp_in) initializer (init (omp_priv, v)) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T5 : omp_out.w *= omp_in.w) initializer (initializer (&omp_priv, N3::v)) // { dg-error "initializer refers to variable" }
+  };
+  S<long int, char, short, _Complex double, W> s;
+  template <typename T1, typename T2, typename T3, typename T4, typename T5>
+  int foo ()
+  {
+    #pragma omp declare reduction (foo : T1 : omp_out |= omp_in) initializer (init (omp_priv, v)) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T2 : omp_out += omp_in) initializer (init (omp_priv, N3::v)) // { dg-error "initializer refers to variable" }
+    typedef T3 T;
+    #pragma omp declare reduction (foo : T : omp_out += omp_in) initializer (initializer (&omp_priv, v)) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T4 : omp_out *= omp_in) initializer (init (omp_priv, v)) // { dg-error "initializer refers to variable" }
+    #pragma omp declare reduction (foo : T5 : omp_out.w *= omp_in.w) initializer (initializer (omp_priv, N3::v)) // { dg-error "initializer refers to variable" }
+    return 0;
+  }
+  int x = foo <long int, char, short, _Complex double, W> ();
+}
--- gcc/testsuite/g++.dg/gomp/udr-3.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/udr-3.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,191 @@
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+struct S { int s; S () : s (0) {} S (int x) : s (x) {} ~S () {} };
+struct T { int t; T () : t (0) {} T (int x) : t (x) {} ~T () {} };
+
+#pragma omp declare reduction (+: ::S: omp_out.s += omp_in.s)
+#pragma omp declare reduction (*: S: omp_out.s *= omp_in.s) \
+		    initializer (omp_priv (1))
+#pragma omp declare reduction (foo: S: omp_out.s += omp_in.s)
+
+void
+f1 ()
+{
+  S s, s2;
+  T t;
+  #pragma omp declare reduction (+: T: omp_out.t += omp_in.t)
+  #pragma omp parallel reduction (+: t) reduction (foo: s) reduction (*: s2)
+  s.s = 1, t.t = 1, s2.s = 2;
+  #pragma omp parallel reduction (::operator +: s)
+  s.s = 1;
+  #pragma omp parallel reduction (+: s)
+  s.s = 1;
+}
+
+template <int N>
+int
+f2 ()
+{
+  S s, s2;
+  T t;
+  #pragma omp declare reduction (+: T: omp_out.t += omp_in.t)
+  #pragma omp parallel reduction (+: t) reduction (foo: s) reduction (*: s2)
+  s.s = 1, t.t = 1, s2.s = 2;
+  #pragma omp parallel reduction (::operator +: s)
+  s.s = 1;
+  #pragma omp parallel reduction (+: s)
+  s.s = 1;
+  return 0;
+}
+
+int x = f2<0> ();
+
+void bar (S &);
+
+void
+f3 ()
+{
+  #pragma omp declare reduction (foo: S: omp_out.s += omp_in.s) initializer (bar (omp_priv))
+  #pragma omp declare reduction (bar: S: omp_out.s += omp_in.s) initializer (bar (omp_orig)) // { dg-error "one of the initializer call arguments should be" }
+}
+
+template <typename T>
+int
+f4 ()
+{
+  #pragma omp declare reduction (foo: T: omp_out.s += omp_in.s) initializer (bar (omp_priv))
+  #pragma omp declare reduction (bar: T: omp_out.s += omp_in.s) initializer (bar (omp_orig)) // { dg-error "one of the initializer call arguments should be" }
+  return 0;
+}
+
+int y = f4 <S> ();
+
+namespace N1
+{
+  #pragma omp declare reduction (+: ::S: omp_out.s *= omp_in.s)		// { dg-error "previous" }
+  #pragma omp declare reduction (+: S: omp_out.s += omp_in.s)		// { dg-error "redeclaration of" }
+  void
+  f5 ()
+  {
+    #pragma omp declare reduction (f5: S: omp_out.s *= omp_in.s)	// { dg-error "previous" }
+    #pragma omp declare reduction (f5: ::S: omp_out.s += omp_in.s)	// { dg-error "redeclaration of" }
+  }
+}
+
+namespace N2
+{
+  struct U
+  {
+    #pragma omp declare reduction (bar: S: omp_out.s *= omp_in.s)	// { dg-error "with" }
+    #pragma omp declare reduction (bar: S: omp_out.s += omp_in.s)	// { dg-error "cannot be overloaded" }
+  };
+}
+
+namespace N3
+{
+  #pragma omp declare reduction (+: ::S: omp_out.s *= omp_in.s)		// { dg-error "previous" }
+  #pragma omp declare reduction (+: T: omp_out.t += omp_in.t)
+  #pragma omp declare reduction (+: S: omp_out.s += omp_in.s)		// { dg-error "redeclaration of" }
+  #pragma omp declare reduction (n3: long: omp_out += omp_in)		// { dg-error "previous" }
+  #pragma omp declare reduction (n3: long int: omp_out += omp_in)	// { dg-error "redeclaration of" }
+  #pragma omp declare reduction (n3: short unsigned: omp_out += omp_in)
+  #pragma omp declare reduction (n3: short int: omp_out += omp_in)
+  void
+  f6 ()
+  {
+    #pragma omp declare reduction (f6: T: omp_out.t += omp_in.t)
+    #pragma omp declare reduction (f6: S: omp_out.s *= omp_in.s)	// { dg-error "previous" }
+    #pragma omp declare reduction (f6: ::S: omp_out.s += omp_in.s)	// { dg-error "redeclaration of" }
+    #pragma omp declare reduction (f6: long: omp_out += omp_in)		// { dg-error "previous" }
+    #pragma omp declare reduction (f6: long int: omp_out += omp_in)	// { dg-error "redeclaration of" }
+    #pragma omp declare reduction (f6: short unsigned: omp_out += omp_in)
+    #pragma omp declare reduction (f6: short int: omp_out += omp_in)
+  }
+}
+
+namespace N4
+{
+  struct U
+  {
+    #pragma omp declare reduction (bar: T: omp_out.t += omp_in.t)
+    #pragma omp declare reduction (bar: S: omp_out.s *= omp_in.s)	// { dg-error "with" }
+    #pragma omp declare reduction (bar: S: omp_out.s += omp_in.s)	// { dg-error "cannot be overloaded" }
+    #pragma omp declare reduction (bar: long: omp_out += omp_in)	// { dg-error "with" }
+    #pragma omp declare reduction (bar: long int: omp_out += omp_in)	// { dg-error "cannot be overloaded" }
+    #pragma omp declare reduction (bar: short unsigned: omp_out += omp_in)
+    #pragma omp declare reduction (bar: short int: omp_out += omp_in)
+  };
+}
+
+namespace N5
+{
+  template <typename T>
+  int
+  f7 ()
+  {
+    #pragma omp declare reduction (f7: T: omp_out.s *= omp_in.s)	// { dg-error "previous" }
+    #pragma omp declare reduction (f7: T: omp_out.s += omp_in.s)	// { dg-error "redeclaration of" }
+    return 0;
+  }
+  int x = f7 <S> ();
+  template <typename T>
+  struct U
+  {
+    #pragma omp declare reduction (bar: T: omp_out.s *= omp_in.s)	// { dg-error "with" }
+    #pragma omp declare reduction (bar: T: omp_out.s += omp_in.s)	// { dg-error "cannot be overloaded" }
+  };
+  U<S> u;
+}
+
+namespace N6
+{
+  template <typename U>
+  int
+  f8 ()
+  {
+    #pragma omp declare reduction (f8: T: omp_out.t += omp_in.t)
+    #pragma omp declare reduction (f8: U: omp_out.s *= omp_in.s)	// { dg-error "previous" }
+    #pragma omp declare reduction (f8: ::S: omp_out.s += omp_in.s)	// { dg-error "redeclaration of" }
+    #pragma omp declare reduction (f8: long: omp_out += omp_in)		// { dg-error "previous" }
+    #pragma omp declare reduction (f8: long int: omp_out += omp_in)	// { dg-error "redeclaration of" }
+    #pragma omp declare reduction (f8: short unsigned: omp_out += omp_in)
+    #pragma omp declare reduction (f8: short int: omp_out += omp_in)
+    return 0;
+  }
+  int x = f8 <S> ();
+  template <typename V>
+  struct U
+  {
+    typedef V V2;
+    #pragma omp declare reduction (bar: T: omp_out.t += omp_in.t)
+    #pragma omp declare reduction (bar: V: omp_out.s *= omp_in.s)	// { dg-error "with" }
+    #pragma omp declare reduction (bar: V2: omp_out.s += omp_in.s)	// { dg-error "cannot be overloaded" }
+    #pragma omp declare reduction (bar: long: omp_out += omp_in)	// { dg-error "with" }
+    #pragma omp declare reduction (bar: long int: omp_out += omp_in)	// { dg-error "cannot be overloaded" }
+    #pragma omp declare reduction (bar: short unsigned: omp_out += omp_in)
+    #pragma omp declare reduction (bar: short int: omp_out += omp_in)
+  };
+  U<S> u;
+}
+
+namespace N7
+{
+  #pragma omp declare reduction (+: S: omp_out.s += omp_in.s) initializer (omp_priv) // { dg-error "invalid initializer clause" }
+  #pragma omp declare reduction (+: T: omp_out.t += omp_in.t) initializer (omp_priv ()) // { dg-error "invalid initializer clause" }
+}
+
+namespace N8
+{
+  struct A { int a; A (); ~A (); };
+  struct B { int b; B (); ~B (); B (int); };
+  struct C : public A, B { int c; C (); ~C (); };
+  #pragma omp declare reduction (+:B:omp_out.b += omp_in.b) initializer (omp_priv (4))
+  void bar (C &);
+  void baz ()
+  {
+    C a;
+    #pragma omp parallel reduction (+:a) // { dg-error "user defined reduction with constructor initializer for base class" }
+    bar (a);
+  }
+}
--- gcc/testsuite/g++.dg/gomp/udr-4.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/udr-4.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+struct S;					// { dg-error "forward declaration" }
+#pragma omp declare reduction (+:S:omp_out.s += omp_in.s) // { dg-error "invalid use of incomplete type" }
+struct S { int s; S () : s (1) {} };
+#pragma omp declare reduction (*:S:omp_out.s *= omp_in.s)
+
+void
+foo ()
+{
+  S s;
+  #pragma omp parallel reduction (S::~S:s)	// { dg-error "invalid reduction-identifier" }
+  s.s = 1;
+}
--- gcc/testsuite/g++.dg/gomp/udr-5.C	(.../trunk)	(revision 0)
+++ gcc/testsuite/g++.dg/gomp/udr-5.C	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,41 @@
+// { dg-do compile }
+
+struct S
+{
+  int s;
+  S () : s (0) {}
+private:
+  #pragma omp declare reduction (+:S:omp_out.s += omp_in.s)	// { dg-error "is private" }
+protected:
+  #pragma omp declare reduction (-:S:omp_out.s += omp_in.s)	// { dg-error "is protected" }
+};
+
+struct T : public S
+{
+  void foo ()
+  {
+    S s;
+    #pragma omp parallel reduction (S::operator +:s)	// { dg-error "within this context" }
+    s.s = 1;
+    S t;
+    #pragma omp parallel reduction (S::operator -:t)
+    t.s = 1;
+    S u;
+    #pragma omp parallel reduction (+:u)		// { dg-error "within this context" }
+    u.s = 1;
+    S v;
+    #pragma omp parallel reduction (-:v)
+    v.s = 1;
+  }
+};
+
+void
+foo ()
+{
+  S s;
+  #pragma omp parallel reduction (S::operator +:s)	// { dg-error "within this context" }
+  s.s = 1;
+  S t;
+  #pragma omp parallel reduction (S::operator -:t)	// { dg-error "within this context" }
+  t.s = 1;
+}
--- gcc/testsuite/gcc.dg/autopar/outer-1.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/autopar/outer-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -28,6 +28,6 @@ int main(void)
 
 /* Check that outer loop is parallelized.  */
 /* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "parloops" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/autopar/outer-2.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/autopar/outer-2.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -28,6 +28,6 @@ int main(void)
 }
 
 /* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "parloops" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/autopar/outer-3.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/autopar/outer-3.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -28,6 +28,6 @@ int main(void)
 
 /* Check that outer loop is parallelized.  */
 /* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "parloops" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/autopar/outer-4.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/autopar/outer-4.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -32,6 +32,6 @@ int main(void)
 
 
 /* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "parloops" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/autopar/outer-5.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/autopar/outer-5.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -45,6 +45,6 @@ int main(void)
 }
 
 /* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "parloops" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/autopar/outer-6.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/autopar/outer-6.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -46,6 +46,6 @@ int main(void)
 /* Check that outer loop is parallelized.  */
 /* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
 /* { dg-final { scan-tree-dump-times "parallelizing inner loop" 0 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "parloops" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/autopar/parallelization-1.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/autopar/parallelization-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -28,6 +28,6 @@ int main(void)
 /* Check that the first loop in parloop got parallelized.  */
 
 /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
-/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "parloops" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/gomp/block-3.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/gomp/block-3.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -35,9 +35,10 @@ void foo()
 
   #pragma omp sections
     {
-      goto ok1;
-      ok1:;
-
+      {
+	goto ok1;
+	ok1:;
+      }
     #pragma omp section
       for (i = 0; i < 10; ++i)
 	if (test(i))
--- gcc/testsuite/gcc.dg/gomp/clause-1.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/gomp/clause-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -11,7 +11,7 @@ int t;
 void
 foo (int x)
 {
-  char *p;
+  char *pp;
   struct S { int i; int j; } s;
   char a[32];
   double d;
@@ -42,11 +42,11 @@ foo (int x)
     ;
 #pragma omp p firstprivate (bar) /* { dg-error "is not a variable" } */
     ;
-#pragma omp p reduction (+:p) /* { dg-error "has invalid type for" } */
+#pragma omp p reduction (+:pp) /* { dg-error "user defined reduction not found for" } */
     ;
-#pragma omp p reduction (*:s) /* { dg-error "has invalid type for" } */
+#pragma omp p reduction (*:s) /* { dg-error "user defined reduction not found for" } */
     ;
-#pragma omp p reduction (-:a) /* { dg-error "has invalid type for" } */
+#pragma omp p reduction (-:a) /* { dg-error "user defined reduction not found for" } */
     ;
   d = 0;
 #pragma omp p reduction (*:d)
--- gcc/testsuite/gcc.dg/gomp/combined-1.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/gomp/combined-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -20,5 +20,5 @@ int foo (void)
       }
 }
 
-/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop_runtime_start" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop_runtime" 3 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/gomp/declare-simd-1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gomp/declare-simd-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,100 @@
+/* Test parsing of #pragma omp declare simd */
+/* { dg-do compile } */
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) \
+	    linear (c : 4) simdlen (8) notinbranch
+#pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a \
+									    : 4) simdlen (4) inbranch
+int f1 (int a, int *b, int c);
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int f2 (int a, int *b, int c)
+{
+  return a + *b + c;
+}
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (long long)) linear (c : 4) simdlen (8)
+__extension__
+long long f3 (long long a, long long *b, long long c);
+
+int
+f4 (int x)
+{
+  #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+  __extension__ __extension__ __extension__
+  extern int f5 (int a, int *b, int c);
+  {
+    x++;
+    #pragma omp declare simd simdlen (4) linear (c)
+    extern int f6 (int a, int *b, int c);
+  }
+  return x;
+}
+
+#pragma omp declare simd simdlen (16)
+int
+f7 (int x)
+{
+  #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+  extern int f8 (int a, int *b, int c);
+  return x;
+}
+
+int
+f9 (int x)
+{
+  if (x)
+    #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+    extern int f10 (int a, int *b, int c);
+  while (x < 10)
+    #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+    extern int f11 (int a, int *b, int c);
+  return x;
+}
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int f12 (int c; int *b; int a; int a, int *b, int c);
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int
+f13 (int c; int *b; int a; int a, int *b, int c)
+{
+  return a + *b + c;
+}
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int
+f14 (a, b, c)
+     int a, c;
+     int *b;
+{
+  return a + *b + c;
+}
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int
+f15 (int a, int *b, int c)
+{
+  return a + *b + c;
+}
+
+#pragma omp declare simd uniform (d) aligned (e : 8 * sizeof (int)) linear (f : 4) simdlen (8)
+int f15 (int d, int *e, int f);
+
+#pragma omp declare simd aligned (g : sizeof (*g)) linear (h : 2 * sizeof (g[0]) + sizeof (h)) simdlen (4)
+int f16 (long *g, int h);
+
+#pragma omp declare simd aligned (h : sizeof (*h)) linear (g : 2 * sizeof (h[0]) + sizeof (g)) simdlen (4)
+int f17 (int g, long *h)
+{
+  return g + h[0];
+}
+
+#pragma omp declare simd aligned (i : sizeof (*i)) linear (j : 2 * sizeof (i[0]) + sizeof (j)) simdlen (4)
+int
+f18 (j, i)
+     long *i;
+     int j;
+{
+  return j + i[0];
+}
--- gcc/testsuite/gcc.dg/gomp/declare-simd-2.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gomp/declare-simd-2.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,24 @@
+/* Test parsing of #pragma omp declare simd */
+/* { dg-do compile } */
+
+#pragma omp declare simd
+int a;	/* { dg-error "not immediately followed by a function declaration or definition" } */
+
+#pragma omp declare simd
+int fn1 (int a), fn2 (int a);	/* { dg-error "not immediately followed by a single function declaration or definition" } */
+
+#pragma omp declare simd
+int b, fn3 (int a);	/* { dg-error "not immediately followed by a function declaration or definition" } */
+
+#pragma omp declare simd linear (a)
+int fn4 (int a), c;	/* { dg-error "not immediately followed by a function declaration or definition" } */
+
+int t;
+
+#pragma omp declare simd
+#pragma omp declare simd
+#pragma omp threadprivate(t)	/* { dg-error "must be followed by function declaration or definition or another" } */
+int fn5 (int a);
+
+#pragma omp declare simd inbranch notinbranch /* { dg-error "clause is incompatible with" } */
+int fn6 (int);
--- gcc/testsuite/gcc.dg/gomp/nesting-1.c	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gcc.dg/gomp/nesting-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -28,17 +28,58 @@ f1 (void)
     #pragma omp for		/* { dg-error "may not be closely nested" } */
     for (j = 0; j < 3; j++)
       ;
+  }
+  #pragma omp sections
+  {
     #pragma omp sections	/* { dg-error "may not be closely nested" } */
     {
       ;
     #pragma omp section
       ;
     }
+  }
+  #pragma omp sections
+  {
     #pragma omp single		/* { dg-error "may not be closely nested" } */
       ;
+  }
+  #pragma omp sections
+  {
     #pragma omp master		/* { dg-error "may not be closely nested" } */
       ;
+  }
+  #pragma omp sections
+  {
+    #pragma omp section
+      ;
+  }
+  #pragma omp sections
+  {
     #pragma omp section
+    #pragma omp for		/* { dg-error "may not be closely nested" } */
+    for (j = 0; j < 3; j++)
+      ;
+  }
+  #pragma omp sections
+  {
+    #pragma omp section
+    #pragma omp sections	/* { dg-error "may not be closely nested" } */
+    {
+      ;
+    #pragma omp section
+      ;
+    }
+  }
+  #pragma omp sections
+  {
+    #pragma omp section
+    #pragma omp single		/* { dg-error "may not be closely nested" } */
+      ;
+  }
+  #pragma omp sections
+  {
+    #pragma omp section
+    #pragma omp master		/* { dg-error "may not be closely nested" } */
       ;
   }
   #pragma omp single
--- gcc/testsuite/gcc.dg/gomp/target-1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gomp/target-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+  bad1:
+  #pragma omp target
+    goto bad1;			/* { dg-error "invalid branch" } */
+
+  goto bad2;			/* { dg-error "invalid entry" } */
+  #pragma omp target
+    {
+      bad2: ;
+    }
+
+  #pragma omp target
+    {
+      int i;
+      goto ok1;
+      for (i = 0; i < 10; ++i)
+	{ ok1: break; }
+    }
+
+  switch (x)			/* { dg-error "invalid entry" } */
+  {
+  #pragma omp target
+    { case 0:; }
+  }
+}
--- gcc/testsuite/gcc.dg/gomp/target-2.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gomp/target-2.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+void
+foo (int x, int y)
+{
+  bad1:
+  #pragma omp target data map(tofrom: y)
+    goto bad1;			/* { dg-error "invalid branch" } */
+
+  goto bad2;			/* { dg-error "invalid entry" } */
+  #pragma omp target data map(tofrom: y)
+    {
+      bad2: ;
+    }
+
+  #pragma omp target data map(tofrom: y)
+    {
+      int i;
+      goto ok1;
+      for (i = 0; i < 10; ++i)
+	{ ok1: break; }
+    }
+
+  switch (x)			/* { dg-error "invalid entry" } */
+  {
+  #pragma omp target data map(tofrom: y)
+    { case 0:; }
+  }
+}
--- gcc/testsuite/gcc.dg/gomp/taskgroup-1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gomp/taskgroup-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+  bad1:
+  #pragma omp taskgroup
+    goto bad1;			/* { dg-error "invalid branch" } */
+
+  goto bad2;			/* { dg-error "invalid entry" } */
+  #pragma omp taskgroup
+    {
+      bad2: ;
+    }
+
+  #pragma omp taskgroup
+    {
+      int i;
+      goto ok1;
+      for (i = 0; i < 10; ++i)
+	{ ok1: break; }
+    }
+
+  switch (x)			/* { dg-error "invalid entry" } */
+  {
+  #pragma omp taskgroup
+    { case 0:; }
+  }
+}
--- gcc/testsuite/gcc.dg/gomp/teams-1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gomp/teams-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+  bad1:
+  #pragma omp target teams
+    goto bad1;			/* { dg-error "invalid branch" } */
+
+  goto bad2;			/* { dg-error "invalid entry" } */
+  #pragma omp target teams
+    {
+      bad2: ;
+    }
+
+  #pragma omp target teams
+    {
+      int i;
+      goto ok1;
+      for (i = 0; i < 10; ++i)
+	{ ok1: break; }
+    }
+
+  switch (x)			/* { dg-error "invalid entry" } */
+  {
+  #pragma omp target teams
+    { case 0:; }
+  }
+}
+
+void
+bar (int x)
+{
+  bad1:
+  #pragma omp target
+  #pragma omp teams
+    goto bad1;			/* { dg-error "invalid branch" } */
+
+  goto bad2;			/* { dg-error "invalid entry" } */
+  #pragma omp target
+  #pragma omp teams
+    {
+      bad2: ;
+    }
+
+  #pragma omp target
+  #pragma omp teams
+    {
+      int i;
+      goto ok1;
+      for (i = 0; i < 10; ++i)
+	{ ok1: break; }
+    }
+
+  switch (x)			/* { dg-error "invalid entry" } */
+  {
+  #pragma omp target
+  #pragma omp teams
+    { case 0:; }
+  }
+}
--- gcc/testsuite/gcc.dg/gomp/udr-1.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gomp/udr-1.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+#pragma omp declare reduction (| : long int : omp_out |= omp_in)	/* { dg-error "predeclared arithmetic type" } */
+#pragma omp declare reduction (+ : char : omp_out += omp_in)		/* { dg-error "predeclared arithmetic type" } */
+typedef short T;
+#pragma omp declare reduction (min : T : omp_out += omp_in)		/* { dg-error "predeclared arithmetic type" } */
+#pragma omp declare reduction (* : _Complex double : omp_out *= omp_in)	/* { dg-error "predeclared arithmetic type" } */
+
+void
+foo (void)
+{
+  #pragma omp declare reduction (| : long int : omp_out |= omp_in)	/* { dg-error "predeclared arithmetic type" } */
+  #pragma omp declare reduction (+ : char : omp_out += omp_in)		/* { dg-error "predeclared arithmetic type" } */
+  #pragma omp declare reduction (min : T : omp_out += omp_in)		/* { dg-error "predeclared arithmetic type" } */
+  #pragma omp declare reduction (* : _Complex double : omp_out *= omp_in) /* { dg-error "predeclared arithmetic type" } */
+}
+
+#pragma omp declare reduction (| : __typeof (foo) : omp_out |= omp_in)	/* { dg-error "function or array" } */
+#pragma omp declare reduction (+ : char () : omp_out += omp_in)		/* { dg-error "function or array" } */
+#pragma omp declare reduction (min : T[2] : omp_out += omp_in)		/* { dg-error "function or array" } */
+
+void
+bar (void)
+{
+  #pragma omp declare reduction (| : __typeof (foo) : omp_out |= omp_in)/* { dg-error "function or array" } */
+  #pragma omp declare reduction (+ : char () : omp_out += omp_in)	/* { dg-error "function or array" } */
+  #pragma omp declare reduction (min : T[2] : omp_out += omp_in)	/* { dg-error "function or array" } */
+}
+
+struct A { int a; };
+#pragma omp declare reduction (| : const struct A : omp_out.a |= omp_in.a)	/* { dg-error "const, volatile or restrict" } */
+#pragma omp declare reduction (+ : __const struct A : omp_out.a += omp_in.a)	/* { dg-error "const, volatile or restrict" } */
+typedef volatile struct A T2;
+#pragma omp declare reduction (min : T2 : omp_out.a += omp_in.a)		/* { dg-error "const, volatile or restrict" } */
+#pragma omp declare reduction (* : struct A *__restrict : omp_out->a *= omp_in->a)/* { dg-error "const, volatile or restrict" } */
+
+void
+baz (void)
+{
+  #pragma omp declare reduction (| : const struct A : omp_out.a |= omp_in.a)	/* { dg-error "const, volatile or restrict" } */
+  #pragma omp declare reduction (+ : __const struct A : omp_out.a += omp_in.a)	/* { dg-error "const, volatile or restrict" } */
+  typedef volatile struct A T3;
+  #pragma omp declare reduction (min : T3 : omp_out.a += omp_in.a)		/* { dg-error "const, volatile or restrict" } */
+  #pragma omp declare reduction (* : struct A *__restrict : omp_out->a *= omp_in->a)/* { dg-error "const, volatile or restrict" } */
+}
--- gcc/testsuite/gcc.dg/gomp/udr-2.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gomp/udr-2.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+struct W { int w; };
+void init (struct W *, int, int *);
+int v;
+#pragma omp declare reduction (foo : long int : omp_out |= v)	/* { dg-error "combiner refers to variable" } */
+#pragma omp declare reduction (foo : char : omp_out = v)	/* { dg-error "combiner refers to variable" } */
+typedef short T;
+#pragma omp declare reduction (foo : T : omp_out += v)	/* { dg-error "combiner refers to variable" } */
+#pragma omp declare reduction (foo : int : v *= omp_in)	/* { dg-error "combiner refers to variable" } */
+#pragma omp declare reduction (foo : struct W : omp_out.w *= omp_in.w + v) /* { dg-error "combiner refers to variable" } */
+
+void
+foo (int v)
+{
+  #pragma omp declare reduction (foo : long int : omp_out |= v)	/* { dg-error "combiner refers to variable" } */
+  #pragma omp declare reduction (foo : char : omp_out = v)	/* { dg-error "combiner refers to variable" } */
+  #pragma omp declare reduction (foo : T : omp_out += v)	/* { dg-error "combiner refers to variable" } */
+  #pragma omp declare reduction (foo : int : v *= omp_in)	/* { dg-error "combiner refers to variable" } */
+  #pragma omp declare reduction (foo : struct W : omp_out.w *= omp_in.w + v) /* { dg-error "combiner refers to variable" } */
+}
+
+#pragma omp declare reduction (bar : long int : omp_out |= omp_in) initializer (omp_priv = v) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar : char : omp_out += omp_in) initializer (omp_priv = ((char) v)) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar : T : omp_out += omp_in) initializer (omp_priv = (short) v) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar : _Complex double : omp_out *= omp_in) initializer (omp_priv = (v)) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar : struct W : omp_out.w *= omp_in.w) initializer (omp_priv = { v } ) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar2 : struct W : omp_out.w *= omp_in.w) initializer (init (&omp_priv, v, (int *) 0)) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar3 : struct W : omp_out.w *= omp_in.w) initializer (init (&omp_priv, 0, &v)) /* { dg-error "initializer refers to variable" } */
+
+void
+bar (int v)
+{
+  #pragma omp declare reduction (bar : long int : omp_out |= omp_in) initializer (omp_priv = v) /* { dg-error "initializer refers to variable" } */
+  #pragma omp declare reduction (bar : char : omp_out += omp_in) initializer (omp_priv = ((char) v)) /* { dg-error "initializer refers to variable" } */
+  #pragma omp declare reduction (bar : T : omp_out += omp_in) initializer (omp_priv = (short) v) /* { dg-error "initializer refers to variable" } */
+  #pragma omp declare reduction (bar : _Complex double : omp_out *= omp_in) initializer (omp_priv = (v)) /* { dg-error "initializer refers to variable" } */
+  #pragma omp declare reduction (bar : struct W : omp_out.w *= omp_in.w) initializer (omp_priv = { v }) /* { dg-error "initializer refers to variable" } */
+  #pragma omp declare reduction (bar2 : struct W : omp_out.w *= omp_in.w) initializer (init (&omp_priv, v, (int *) 0)) /* { dg-error "initializer refers to variable" } */
+  #pragma omp declare reduction (bar3 : struct W : omp_out.w *= omp_in.w) initializer (init (&omp_priv, 0, &v)) /* { dg-error "initializer refers to variable" } */
+}
--- gcc/testsuite/gcc.dg/gomp/udr-3.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gomp/udr-3.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,77 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+struct S { int s; };
+struct T { int t; };
+struct U { int u; };
+
+#pragma omp declare reduction (+: struct S: omp_out.s += omp_in.s)
+#pragma omp declare reduction (*: struct S: omp_out.s *= omp_in.s) \
+		    initializer (omp_priv = {1})
+#pragma omp declare reduction (foo: struct S: omp_out.s += omp_in.s)
+
+void
+f1 ()
+{
+  struct S s, s2;
+  struct T t;
+  #pragma omp declare reduction (+: struct T: omp_out.t += omp_in.t)
+  #pragma omp parallel reduction (+: t) reduction (foo: s) reduction (*: s2)
+  s.s = 1, t.t = 1, s2.s = 2;
+  #pragma omp parallel reduction (+: s)
+  s.s = 1;
+}
+
+void bar (struct S *);
+
+void
+f2 ()
+{
+  #pragma omp declare reduction (foo: struct S: omp_out.s += omp_in.s) initializer (bar (&omp_priv))
+  #pragma omp declare reduction (bar: struct S: omp_out.s += omp_in.s) initializer (bar (&omp_orig)) /* { dg-error "one of the initializer call arguments should be" } */
+}
+
+#pragma omp declare reduction (+: struct U: omp_out.u *= omp_in.u)		/* { dg-error "previous" } */
+#pragma omp declare reduction (+: struct U: omp_out.u += omp_in.u)		/* { dg-error "redeclaration of" } */
+
+void
+f3 ()
+{
+  #pragma omp declare reduction (f3: struct U: omp_out.u *= omp_in.u)		/* { dg-error "previous" } */
+  #pragma omp declare reduction (f3: struct U: omp_out.u += omp_in.u)		/* { dg-error "redeclaration of" } */
+}
+
+struct V
+{
+  #pragma omp declare reduction (bar: struct S: omp_out.s *= omp_in.s)		/* { dg-error "not at file or block scope" } */
+  #pragma omp declare reduction (bar: struct S: omp_out.s += omp_in.s)		/* { dg-error "not at file or block scope" } */
+};
+
+#pragma omp declare reduction (n3: long: omp_out += omp_in)		/* { dg-error "previous" } */
+#pragma omp declare reduction (n3: long int: omp_out += omp_in)		/* { dg-error "redeclaration of" } */
+#pragma omp declare reduction (n3: short unsigned: omp_out += omp_in)
+#pragma omp declare reduction (n3: short int: omp_out += omp_in)
+
+void
+f4 (void)
+{
+  #pragma omp declare reduction (f4: long: omp_out += omp_in)		/* { dg-error "previous" } */
+  #pragma omp declare reduction (f4: long int: omp_out += omp_in)	/* { dg-error "redeclaration of" } */
+  #pragma omp declare reduction (f4: short unsigned: omp_out += omp_in)
+  #pragma omp declare reduction (f4: short int: omp_out += omp_in)
+}
+
+void
+f5 (void)
+{
+  #pragma omp declare reduction (+: struct S: omp_out.s += omp_in.s) initializer (omp_priv) /* { dg-error "expected" } */
+  #pragma omp declare reduction (+: struct T: omp_out.t += omp_in.t) initializer (omp_priv ()) /* { dg-error "expected" } */
+}
+
+void
+f6 (a, b)
+#pragma omp declare reduction (bar: struct S: omp_out.s *= omp_in.s)	/* { dg-error "expected declaration specifiers before" } */
+  int a;
+  int b;
+{
+}
--- gcc/testsuite/gcc.dg/gomp/udr-4.c	(.../trunk)	(revision 0)
+++ gcc/testsuite/gcc.dg/gomp/udr-4.c	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+
+struct S;
+#pragma omp declare reduction (+:struct S:omp_out.s += omp_in.s) /* { dg-error "invalid use of undefined type" } */
+struct S { int s; };
+#pragma omp declare reduction (*:struct S:omp_out.s *= omp_in.s)
--- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.5.f90	(.../trunk)	(revision 203241)
+++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.5.f90	(.../branches/gomp-4_0-branch)	(revision 203287)
@@ -6,7 +6,7 @@
 !$OMP CRITICAL
             CALL WORK(N,1)
 ! incorrect nesting of barrier region in a critical region
-!$OMP BARRIER
+!$OMP BARRIER	! { dg-error "region may not be closely nested inside of" }
             CALL WORK(N,2)
 !$OMP END CRITICAL
 !$OMP END PARALLEL

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]