[committed,4/4] (Partial) OpenMP 5.0 support for GCC 9 (gcc testsuite)

Message ID 20181108172030.GO11625@tucnak
State New
Headers show
Series
  • (Partial) OpenMP 5.0 support for GCC 9
Related show

Commit Message

Jakub Jelinek Nov. 8, 2018, 5:20 p.m.
Hi!

This is the gcc/testsuite/ part of the gomp-5_0-branch
merge to trunk I've just committed.

2018-11-08  Jakub Jelinek  <jakub@redhat.com>

	* c-c++-common/gomp/atomic-17.c: New test.
	* c-c++-common/gomp/atomic-18.c: New test.
	* c-c++-common/gomp/atomic-19.c: New test.
	* c-c++-common/gomp/atomic-20.c: New test.
	* c-c++-common/gomp/atomic-21.c: New test.
	* c-c++-common/gomp/atomic-22.c: New test.
	* c-c++-common/gomp/clauses-1.c (r2): New variable.
	(foo): Add ntm argument and test if and nontemporal clauses on
	constructs with simd.
	(bar): Put taskloop simd inside of taskgroup with task_reduction,
	use in_reduction clause instead of reduction.  Add another
	taskloop simd without nogroup clause, but with reduction clause and
	a new in_reduction.  Add ntm and i3 arguments.  Test if and
	nontemporal clauses on constructs with simd.  Change if clauses on
	some constructs from specific to the particular constituents to one
	without a modifier.  Add new tests for combined host teams and for
	new parallel master and {,parallel }master taskloop{, simd} combined
	constructs.
	(baz): New function with host teams tests.
	* gcc.dg/gomp/combined-1.c: Moved to ...
	* c-c++-common/gomp/combined-1.c: ... here.  Adjust expected library
	call.
	* c-c++-common/gomp/combined-2.c: New test.
	* c-c++-common/gomp/combined-3.c: New test.
	* c-c++-common/gomp/critical-1.c: New test.
	* c-c++-common/gomp/critical-2.c: New test.
	* c-c++-common/gomp/default-1.c: New test.
	* c-c++-common/gomp/defaultmap-1.c: New test.
	* c-c++-common/gomp/defaultmap-2.c: New test.
	* c-c++-common/gomp/defaultmap-3.c: New test.
	* c-c++-common/gomp/depend-5.c: New test.
	* c-c++-common/gomp/depend-6.c: New test.
	* c-c++-common/gomp/depend-iterator-1.c: New test.
	* c-c++-common/gomp/depend-iterator-2.c: New test.
	* c-c++-common/gomp/depobj-1.c: New test.
	* c-c++-common/gomp/flush-1.c: New test.
	* c-c++-common/gomp/flush-2.c: New test.
	* c-c++-common/gomp/for-1.c: New test.
	* c-c++-common/gomp/for-2.c: New test.
	* c-c++-common/gomp/for-3.c: New test.
	* c-c++-common/gomp/for-4.c: New test.
	* c-c++-common/gomp/for-5.c: New test.
	* c-c++-common/gomp/for-6.c: New test.
	* c-c++-common/gomp/for-7.c: New test.
	* c-c++-common/gomp/if-1.c (foo): Add some further tests.
	* c-c++-common/gomp/if-2.c (foo): Likewise.  Expect slightly different
	diagnostics wording in one case.
	* c-c++-common/gomp/if-3.c: New test.
	* c-c++-common/gomp/master-combined-1.c: New test.
	* c-c++-common/gomp/master-combined-2.c: New test.
	* c-c++-common/gomp/nontemporal-1.c: New test.
	* c-c++-common/gomp/nontemporal-2.c: New test.
	* c-c++-common/gomp/reduction-task-1.c: New test.
	* c-c++-common/gomp/reduction-task-2.c: New test.
	* c-c++-common/gomp/requires-1.c: New test.
	* c-c++-common/gomp/requires-2.c: New test.
	* c-c++-common/gomp/requires-3.c: New test.
	* c-c++-common/gomp/requires-4.c: New test.
	* c-c++-common/gomp/schedule-modifiers-1.c (bar): Don't expect
	diagnostics for nonmonotonic modifier with static, runtime or auto
	schedule kinds.
	* c-c++-common/gomp/simd7.c: New test.
	* c-c++-common/gomp/target-data-1.c: New test.
	* c-c++-common/gomp/taskloop-reduction-1.c: New test.
	* c-c++-common/gomp/taskwait-depend-1.c: New test.
	* c-c++-common/gomp/teams-1.c: New test.
	* c-c++-common/gomp/teams-2.c: New test.
	* gcc.dg/gomp/appendix-a/a.24.1.c: Update from OpenMP examples.  Add
	shared(c) clause.
	* gcc.dg/gomp/atomic-5.c (f1): Add another expected error.
	* gcc.dg/gomp/clause-1.c: Adjust expected diagnostics for const
	qualified vars without mutable member no longer being predeterined
	shared.
	* gcc.dg/gomp/sharing-1.c: Likewise.
	* g++.dg/gomp/clause-3.C: Likewise.
	* g++.dg/gomp/member-2.C: Likewise.
	* g++.dg/gomp/predetermined-1.C: Likewise.
	* g++.dg/gomp/private-1.C: Likewise.
	* g++.dg/gomp/sharing-1.C: Likewise.
	* g++.dg/gomp/sharing-2.C: Likewise.  Add a few tests with aggregate
	const static data member without mutable elements.
	* gcc.dg/gomp/for-4.c: Expected nonmonotonic functions in the dumps.
	* gcc.dg/gomp/for-5.c: Likewise.
	* gcc.dg/gomp/for-6.c: Change expected library call.
	* gcc.dg/gomp/pr39495-2.c (foo): Don't expect errors on !=.
	* gcc.dg/gomp/reduction-2.c: New test.
	* gcc.dg/gomp/simd-1.c: New test.
	* gcc.dg/gomp/teams-1.c: Adjust expected diagnostic lines.
	* g++.dg/gomp/atomic-18.C: New test.
	* g++.dg/gomp/atomic-19.C: New test.
	* g++.dg/gomp/atomic-5.C (f1): Adjust expected lines of read-only
	variable messages.  Add another expected error.
	* g++.dg/gomp/critical-3.C: New test.
	* g++.dg/gomp/depend-iterator-1.C: New test.
	* g++.dg/gomp/depend-iterator-2.C: New test.
	* g++.dg/gomp/depobj-1.C: New test.
	* g++.dg/gomp/doacross-1.C: New test.
	* g++.dg/gomp/for-21.C: New test.
	* g++.dg/gomp/for-4.C: Expected nonmonotonic functions in the dumps.
	* g++.dg/gomp/for-5.C: Likewise.
	* g++.dg/gomp/for-6.C: Change expected library call.
	* g++.dg/gomp/loop-4.C: New test.
	* g++.dg/gomp/pr33372-1.C: Adjust location of the expected
	diagnostics.
	* g++.dg/gomp/pr33372-3.C: Likewise.
	* g++.dg/gomp/pr39495-2.C (foo): Don't expect errors on !=.
	* g++.dg/gomp/simd-2.C: New test.
	* g++.dg/gomp/tpl-atomic-2.C: Adjust expected diagnostic lines.



	Jakub

Patch

--- gcc/testsuite/c-c++-common/gomp/atomic-17.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/atomic-17.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,29 @@ 
+int i, v;
+float f;
+
+void
+foo ()
+{
+  #pragma omp atomic release, hint (0), update
+  i = i + 1;
+  #pragma omp atomic hint(0)seq_cst
+  i = i + 1;
+  #pragma omp atomic relaxed,update,hint (0)
+  i = i + 1;
+  #pragma omp atomic release
+  i = i + 1;
+  #pragma omp atomic relaxed
+  i = i + 1;
+  #pragma omp atomic acq_rel capture
+  v = i = i + 1;
+  #pragma omp atomic capture,acq_rel , hint (1)
+  v = i = i + 1;
+  #pragma omp atomic hint(0),acquire capture
+  v = i = i + 1;
+  #pragma omp atomic read acquire
+  v = i;
+  #pragma omp atomic release,write
+  i = v;
+  #pragma omp atomic hint(1),update,release
+  f = f + 2.0;
+}
--- gcc/testsuite/c-c++-common/gomp/atomic-18.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/atomic-18.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,35 @@ 
+int i, v;
+float f;
+
+void
+foo (int j)
+{
+  #pragma omp atomic update,update	/* { dg-error "too many atomic clauses" } */
+  i = i + 1;
+  #pragma omp atomic seq_cst release	/* { dg-error "too many memory order clauses" } */
+  i = i + 1;
+  #pragma omp atomic read,release	/* { dg-error "incompatible with 'acq_rel' or 'release' clauses" } */
+  v = i;
+  #pragma omp atomic acq_rel read	/* { dg-error "incompatible with 'acq_rel' or 'release' clauses" } */
+  v = i;
+  #pragma omp atomic write acq_rel	/* { dg-error "incompatible with 'acq_rel' or 'acquire' clauses" } */
+  i = v;
+  #pragma omp atomic acquire , write	/* { dg-error "incompatible with 'acq_rel' or 'acquire' clauses" } */
+  i = v;
+  #pragma omp atomic update ,acquire	/* { dg-error "incompatible with 'acq_rel' or 'acquire' clauses" } */
+  i = i + 1;
+  #pragma omp atomic acq_rel update	/* { dg-error "incompatible with 'acq_rel' or 'acquire' clauses" } */
+  i = i + 1;
+  #pragma omp atomic acq_rel,hint(0)	/* { dg-error "incompatible with 'acq_rel' or 'acquire' clauses" } */
+  i = i + 1;
+  #pragma omp atomic acquire		/* { dg-error "incompatible with 'acq_rel' or 'acquire' clauses" } */
+  i = i + 1;
+  #pragma omp atomic capture hint (0) capture	/* { dg-error "too many atomic clauses" } */
+  v = i = i + 1;
+  #pragma omp atomic hint(j + 2)	/* { dg-error "constant integer expression" } */
+  i = i + 1;
+  #pragma omp atomic hint(f)		/* { dg-error "integ" } */
+  i = i + 1;
+  #pragma omp atomic foobar		/* { dg-error "expected 'read', 'write', 'update', 'capture', 'seq_cst', 'acq_rel', 'release', 'relaxed' or 'hint' clause" } */
+  i = i + 1;				/* { dg-error "expected end of line before" "" { target *-*-* } .-1 } */
+}
--- gcc/testsuite/c-c++-common/gomp/atomic-19.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/atomic-19.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,27 @@ 
+/* { dg-do compile } */
+/* { dg-additional-options "-fdump-tree-original" } */
+/* { dg-final { scan-tree-dump-times "omp atomic release" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "omp atomic relaxed" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "omp atomic read relaxed" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "omp atomic capture relaxed" 1 "original" } } */
+
+int i, j, k, l, m, n;
+
+void
+foo ()
+{
+  int v;
+  #pragma omp atomic release
+  i = i + 1;
+  #pragma omp requires atomic_default_mem_order (relaxed)
+  #pragma omp atomic
+  j = j + 1;
+  #pragma omp atomic update
+  k = k + 1;
+  #pragma omp atomic read
+  v = l;
+  #pragma omp atomic write
+  m = v;
+  #pragma omp atomic capture
+  v = n = n + 1;
+}
--- gcc/testsuite/c-c++-common/gomp/atomic-20.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/atomic-20.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,27 @@ 
+/* { dg-do compile } */
+/* { dg-additional-options "-fdump-tree-original" } */
+/* { dg-final { scan-tree-dump-times "omp atomic release" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "omp atomic seq_cst" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "omp atomic read seq_cst" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "omp atomic capture seq_cst" 1 "original" } } */
+
+int i, j, k, l, m, n;
+
+void
+foo ()
+{
+  int v;
+  #pragma omp atomic release
+  i = i + 1;
+  #pragma omp requires atomic_default_mem_order (seq_cst)
+  #pragma omp atomic
+  j = j + 1;
+  #pragma omp atomic update
+  k = k + 1;
+  #pragma omp atomic read
+  v = l;
+  #pragma omp atomic write
+  m = v;
+  #pragma omp atomic capture
+  v = n = n + 1;
+}
--- gcc/testsuite/c-c++-common/gomp/atomic-21.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/atomic-21.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,26 @@ 
+/* { dg-do compile } */
+/* { dg-additional-options "-fdump-tree-original" } */
+/* { dg-final { scan-tree-dump-times "omp atomic release" 4 "original" } } */
+/* { dg-final { scan-tree-dump-times "omp atomic read acquire" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "omp atomic capture acq_rel" 1 "original" } } */
+
+int i, j, k, l, m, n;
+
+void
+foo ()
+{
+  int v;
+  #pragma omp atomic release
+  i = i + 1;
+  #pragma omp requires atomic_default_mem_order (acq_rel)
+  #pragma omp atomic
+  j = j + 1;
+  #pragma omp atomic update
+  k = k + 1;
+  #pragma omp atomic read
+  v = l;
+  #pragma omp atomic write
+  m = v;
+  #pragma omp atomic capture
+  v = n = n + 1;
+}
--- gcc/testsuite/c-c++-common/gomp/atomic-22.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/atomic-22.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,12 @@ 
+int i, j;
+
+void
+foo ()
+{
+  int v;
+  #pragma omp atomic release
+  i = i + 1;
+  #pragma omp atomic read
+  v = j;
+  #pragma omp requires atomic_default_mem_order (acq_rel)	/* { dg-error "'atomic_default_mem_order' clause used lexically after first 'atomic' construct without memory order clause" } */
+}
--- gcc/testsuite/c-c++-common/gomp/clauses-1.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/c-c++-common/gomp/clauses-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -5,11 +5,11 @@  int t;
 #pragma omp threadprivate (t)
 
 #pragma omp declare target
-int f, l, ll, r;
+int f, l, ll, r, r2;
 
 void
 foo (int d, int m, int i1, int i2, int p, int *idp, int s,
-     int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q)
+     int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q, int ntm)
 {
   #pragma omp distribute parallel for \
     private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \
@@ -19,26 +19,50 @@  foo (int d, int m, int i1, int i2, int p
     ll++;
   #pragma omp distribute parallel for simd \
     private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \
-    if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
-    lastprivate (l) schedule(static, 4) \
+    if (parallel: i2) if(simd: i1) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
+    lastprivate (l) schedule(static, 4) nontemporal(ntm) \
     safelen(8) simdlen(4) aligned(q: 32)
   for (int i = 0; i < 64; i++)
     ll++;
   #pragma omp distribute simd \
     private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \
-    safelen(8) simdlen(4) aligned(q: 32) reduction(+:r)
+    safelen(8) simdlen(4) aligned(q: 32) reduction(+:r) if(i1) nontemporal(ntm)
   for (int i = 0; i < 64; i++)
     ll++;
 }
 #pragma omp end declare target
 
 void
-bar (int d, int m, int i1, int i2, int p, int *idp, int s,
-     int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q, int *dd)
+baz (int d, int m, int i1, int i2, int p, int *idp, int s,
+     int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q, int ntm)
+{
+  #pragma omp distribute parallel for \
+    private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \
+    if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
+    lastprivate (l) schedule(static, 4) copyin(t)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp distribute parallel for simd \
+    private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \
+    if (parallel: i2) if(simd: i1) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
+    lastprivate (l) schedule(static, 4) nontemporal(ntm) \
+    safelen(8) simdlen(4) aligned(q: 32) copyin(t)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp distribute simd \
+    private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \
+    safelen(8) simdlen(4) aligned(q: 32) reduction(+:r) if(i1) nontemporal(ntm)
+  for (int i = 0; i < 64; i++)
+    ll++;
+}
+
+void
+bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s,
+     int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q, int *dd, int ntm)
 {
   #pragma omp for simd \
     private (p) firstprivate (f) lastprivate (l) linear (ll:1) reduction(+:r) schedule(static, 4) collapse(1) nowait \
-    safelen(8) simdlen(4) aligned(q: 32)
+    safelen(8) simdlen(4) aligned(q: 32) nontemporal(ntm) if(i1)
   for (int i = 0; i < 64; i++)
     ll++;
   #pragma omp parallel for \
@@ -47,9 +71,9 @@  bar (int d, int m, int i1, int i2, int p
   for (int i = 0; i < 64; i++)
     ll++;
   #pragma omp parallel for simd \
-    private (p) firstprivate (f) if (parallel: i2) default(shared) shared(s) copyin(t) reduction(+:r) num_threads (nth) proc_bind(spread) \
+    private (p) firstprivate (f) if (i2) default(shared) shared(s) copyin(t) reduction(+:r) num_threads (nth) proc_bind(spread) \
     lastprivate (l) linear (ll:1) schedule(static, 4) collapse(1) \
-    safelen(8) simdlen(4) aligned(q: 32)
+    safelen(8) simdlen(4) aligned(q: 32) nontemporal(ntm)
   for (int i = 0; i < 64; i++)
     ll++;
   #pragma omp parallel sections \
@@ -76,7 +100,7 @@  bar (int d, int m, int i1, int i2, int p
     device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
     if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
     lastprivate (l) linear (ll:1) schedule(static, 4) collapse(1) \
-    safelen(8) simdlen(4) aligned(q: 32) nowait depend(inout: dd[0])
+    safelen(8) simdlen(4) aligned(q: 32) nowait depend(inout: dd[0]) nontemporal(ntm) if (simd: i3)
   for (int i = 0; i < 64; i++)
     ll++;
   #pragma omp target teams \
@@ -103,31 +127,38 @@  bar (int d, int m, int i1, int i2, int p
     collapse(1) dist_schedule(static, 16) \
     if (parallel: i2) num_threads (nth) proc_bind(spread) \
     lastprivate (l) schedule(static, 4) \
-    safelen(8) simdlen(4) aligned(q: 32) nowait depend(inout: dd[0])
+    safelen(8) simdlen(4) aligned(q: 32) nowait depend(inout: dd[0]) nontemporal(ntm) if (simd: i3)
   for (int i = 0; i < 64; i++)
     ll++;
   #pragma omp target teams distribute simd \
-    device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
+    device(d) map (tofrom: m) if (i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
     shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
     collapse(1) dist_schedule(static, 16) \
-    safelen(8) simdlen(4) aligned(q: 32) nowait depend(inout: dd[0])
+    safelen(8) simdlen(4) aligned(q: 32) nowait depend(inout: dd[0]) nontemporal(ntm)
   for (int i = 0; i < 64; i++)
     ll++;
   #pragma omp target simd \
     device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
     safelen(8) simdlen(4) lastprivate (l) linear(ll: 1) aligned(q: 32) reduction(+:r) \
-     nowait depend(inout: dd[0])
+     nowait depend(inout: dd[0]) nontemporal(ntm) if(simd:i3)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp taskgroup task_reduction(+:r2)
+  #pragma omp taskloop simd \
+    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) grainsize (g) collapse(1) untied if(taskloop: i1) if(simd: i2) final(fi) mergeable priority (pp) \
+    safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(default, +:r) in_reduction(+:r2) nontemporal(ntm)
   for (int i = 0; i < 64; i++)
     ll++;
+  #pragma omp taskgroup task_reduction(+:r)
   #pragma omp taskloop simd \
-    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) grainsize (g) collapse(1) untied if(taskloop: i1) final(fi) mergeable nogroup priority (pp) \
-    safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(+:r)
+    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) grainsize (g) collapse(1) untied if(i1) final(fi) mergeable nogroup priority (pp) \
+    safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) in_reduction(+:r) nontemporal(ntm)
   for (int i = 0; i < 64; i++)
     ll++;
   #pragma omp taskwait
   #pragma omp taskloop simd \
     private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) num_tasks (nta) collapse(1) if(taskloop: i1) final(fi) priority (pp) \
-    safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(+:r)
+    safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(+:r) if (simd: i3) nontemporal(ntm)
   for (int i = 0; i < 64; i++)
     ll++;
   #pragma omp target nowait depend(inout: dd[0])
@@ -150,14 +181,83 @@  bar (int d, int m, int i1, int i2, int p
     collapse(1) dist_schedule(static, 16) \
     if (parallel: i2) num_threads (nth) proc_bind(spread) \
     lastprivate (l) schedule(static, 4) \
-    safelen(8) simdlen(4) aligned(q: 32)
+    safelen(8) simdlen(4) aligned(q: 32) if (simd: i3) nontemporal(ntm)
   for (int i = 0; i < 64; i++)
     ll++;
   #pragma omp target
   #pragma omp teams distribute simd \
     private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
     collapse(1) dist_schedule(static, 16) \
-    safelen(8) simdlen(4) aligned(q: 32)
+    safelen(8) simdlen(4) aligned(q: 32) if(i3) nontemporal(ntm)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp teams distribute parallel for \
+    private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
+    collapse(1) dist_schedule(static, 16) \
+    if (parallel: i2) num_threads (nth) proc_bind(spread) \
+    lastprivate (l) schedule(static, 4) copyin(t)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp teams distribute parallel for simd \
+    private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
+    collapse(1) dist_schedule(static, 16) \
+    if (parallel: i2) num_threads (nth) proc_bind(spread) \
+    lastprivate (l) schedule(static, 4) \
+    safelen(8) simdlen(4) aligned(q: 32) if (simd: i3) nontemporal(ntm) copyin(t)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp teams distribute simd \
+    private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
+    collapse(1) dist_schedule(static, 16) \
+    safelen(8) simdlen(4) aligned(q: 32) if(i3) nontemporal(ntm)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp parallel master \
+    private (p) firstprivate (f) if (parallel: i2) default(shared) shared(s) reduction(+:r) \
+    num_threads (nth) proc_bind(spread) copyin(t)
+    ;
+  #pragma omp taskgroup task_reduction (+:r2)
+  #pragma omp master taskloop \
+    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) grainsize (g) collapse(1) untied if(taskloop: i1) final(fi) mergeable priority (pp) \
+    reduction(default, +:r) in_reduction(+:r2)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp taskgroup task_reduction (+:r2)
+  #pragma omp master taskloop simd \
+    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) grainsize (g) collapse(1) untied if(taskloop: i1) if(simd: i2) final(fi) mergeable priority (pp) \
+    safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(default, +:r) in_reduction(+:r2) nontemporal(ntm)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp parallel master taskloop \
+    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) grainsize (g) collapse(1) untied if(taskloop: i1) final(fi) mergeable priority (pp) \
+    reduction(default, +:r) if (parallel: i2) num_threads (nth) proc_bind(spread) copyin(t)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp parallel master taskloop simd \
+    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) grainsize (g) collapse(1) untied if(taskloop: i1) if(simd: i2) final(fi) mergeable priority (pp) \
+    safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(default, +:r) nontemporal(ntm) if (parallel: i2) num_threads (nth) proc_bind(spread) copyin(t)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp taskgroup task_reduction (+:r2)
+  #pragma omp master taskloop \
+    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) num_tasks (nta) collapse(1) untied if(i1) final(fi) mergeable priority (pp) \
+    reduction(default, +:r) in_reduction(+:r2)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp taskgroup task_reduction (+:r2)
+  #pragma omp master taskloop simd \
+    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) num_tasks (nta) collapse(1) untied if(i1) final(fi) mergeable priority (pp) \
+    safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(default, +:r) in_reduction(+:r2) nontemporal(ntm)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp parallel master taskloop \
+    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) num_tasks (nta) collapse(1) untied if(i1) final(fi) mergeable priority (pp) \
+    reduction(default, +:r) num_threads (nth) proc_bind(spread) copyin(t)
+  for (int i = 0; i < 64; i++)
+    ll++;
+  #pragma omp parallel master taskloop simd \
+    private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) num_tasks (nta) collapse(1) untied if(i1) final(fi) mergeable priority (pp) \
+    safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(default, +:r) nontemporal(ntm) num_threads (nth) proc_bind(spread) copyin(t)
   for (int i = 0; i < 64; i++)
     ll++;
 }
--- gcc/testsuite/c-c++-common/gomp/combined-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/combined-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,23 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O1 -fopenmp -fdump-tree-optimized" } */
+
+int a[10];
+void foo (void)
+{
+    int i;
+#pragma omp parallel for schedule(runtime)
+    for (i = 0; i < 10; i++)
+      a[i] = i;
+#pragma omp parallel
+#pragma omp for schedule(runtime)
+    for (i = 0; i < 10; i++)
+      a[i] = 10 - i;
+#pragma omp parallel
+      {
+#pragma omp for schedule(runtime)
+	for (i = 0; i < 10; i++)
+	  a[i] = i;
+      }
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop_maybe_nonmonotonic_runtime" 3 "optimized" } } */
--- gcc/testsuite/c-c++-common/gomp/combined-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/combined-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,23 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O1 -fopenmp -fdump-tree-optimized" } */
+
+int a[10];
+void foo (void)
+{
+    int i;
+#pragma omp parallel for schedule(monotonic:runtime)
+    for (i = 0; i < 10; i++)
+      a[i] = i;
+#pragma omp parallel
+#pragma omp for schedule(monotonic :runtime)
+    for (i = 0; i < 10; i++)
+      a[i] = 10 - i;
+#pragma omp parallel
+      {
+#pragma omp for schedule(monotonic: runtime)
+	for (i = 0; i < 10; i++)
+	  a[i] = i;
+      }
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop_runtime" 3 "optimized" } } */
--- gcc/testsuite/c-c++-common/gomp/combined-3.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/combined-3.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,23 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O1 -fopenmp -fdump-tree-optimized" } */
+
+int a[10];
+void foo (void)
+{
+    int i;
+#pragma omp parallel for schedule(nonmonotonic:runtime)
+    for (i = 0; i < 10; i++)
+      a[i] = i;
+#pragma omp parallel
+#pragma omp for schedule(nonmonotonic :runtime)
+    for (i = 0; i < 10; i++)
+      a[i] = 10 - i;
+#pragma omp parallel
+      {
+#pragma omp for schedule(nonmonotonic: runtime)
+	for (i = 0; i < 10; i++)
+	  a[i] = i;
+      }
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop_nonmonotonic_runtime" 3 "optimized" } } */
--- gcc/testsuite/c-c++-common/gomp/critical-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/critical-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,14 @@ 
+int i;
+
+void
+foo (void)
+{
+  #pragma omp critical
+  i = i + 1;
+  #pragma omp critical (foo)
+  i = i + 1;
+  #pragma omp critical (foo) hint (0)
+  i = i + 1;
+  #pragma omp critical (foo),hint(1)
+  i = i + 1;
+}
--- gcc/testsuite/c-c++-common/gomp/critical-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/critical-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,10 @@ 
+int i;
+
+void
+foo (int j)
+{
+  #pragma omp critical (foo) hint (j + 1)	/* { dg-error "constant integer expression" } */
+  i = i + 1;
+  #pragma omp critical (foo),hint(j)		/* { dg-error "constant integer expression" } */
+  i = i + 1;
+}
--- gcc/testsuite/c-c++-common/gomp/default-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/default-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,22 @@ 
+void
+foo (void)
+{
+  int x = 0, i;
+  #pragma omp task default(none)	/* { dg-error "enclosing 'task'" } */
+  {
+    x++;	/* { dg-error "'x' not specified in enclosing 'task'" } */
+  }
+  #pragma omp taskloop default(none)	/* { dg-error "enclosing 'taskloop'" } */
+  for (i = 0; i < 64; i++)
+    {
+      x++;	/* { dg-error "'x' not specified in enclosing 'taskloop'" } */
+    }
+  #pragma omp teams default(none)	/* { dg-error "enclosing 'teams'" } */
+  {
+    x++;	/* { dg-error "'x' not specified in enclosing 'teams'" } */
+  }
+  #pragma omp parallel default(none)	/* { dg-error "enclosing 'parallel'" } */
+  {
+    x++;	/* { dg-error "'x' not specified in enclosing 'parallel'" } */
+  }
+}
--- gcc/testsuite/c-c++-common/gomp/defaultmap-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/defaultmap-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,30 @@ 
+void
+foo (void)
+{
+  #pragma omp target defaultmap(alloc) defaultmap(alloc)	/* { dg-error "too many 'defaultmap' clauses with unspecified category" } */
+  ;
+  #pragma omp target defaultmap(to) defaultmap(from)		/* { dg-error "too many 'defaultmap' clauses with unspecified category" } */
+  ;
+  #pragma omp target defaultmap(tofrom) defaultmap(firstprivate:scalar)	/* { dg-error "too many 'defaultmap' clauses with 'scalar' category" } */
+  ;
+  #pragma omp target defaultmap(none:aggregate) defaultmap(alloc:scalar) defaultmap(none:scalar) /* { dg-error "too many 'defaultmap' clauses with 'scalar' category" } */
+  ;
+  #pragma omp target defaultmap(none : pointer) defaultmap ( none ) /* { dg-error "too many 'defaultmap' clauses with 'pointer' category" } */
+  ;
+  #pragma omp target defaultmap()				/* { dg-error "expected" } */
+  ;
+  #pragma omp target defaultmap(for)				/* { dg-error "expected" } */
+  ;
+  #pragma omp target defaultmap(blah)				/* { dg-error "expected" } */
+  ;
+  #pragma omp target defaultmap(tofrom:)			/* { dg-error "expected" } */
+  ;
+  #pragma omp target defaultmap(tofrom scalar)			/* { dg-error "expected" } */
+  ;
+  #pragma omp target defaultmap(tofrom,scalar)			/* { dg-error "expected" } */
+  ;
+  #pragma omp target defaultmap(default ;)			/* { dg-error "expected" } */
+  ;
+  #pragma omp target defaultmap(default : qux)			/* { dg-error "expected" } */
+  ;
+}
--- gcc/testsuite/c-c++-common/gomp/defaultmap-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/defaultmap-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,131 @@ 
+/* { dg-do compile } */
+/* { dg-additional-options "-fdump-tree-gimple" } */
+
+struct S { int s; };
+void foo (char *);
+void bar (int, char *, struct S, int *);
+#pragma omp declare target to (bar)
+#define N 16
+
+void
+f1 (int sc1, struct S ag1, int *pt1)
+{
+  char ar1[N];
+  foo (ar1);
+  #pragma omp target
+  bar (sc1, ar1, ag1, pt1);
+/* { dg-final { scan-tree-dump "firstprivate\\(sc1\\)" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(tofrom:ar1" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(tofrom:ag1" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(firstprivate:pt1 .pointer assign" "gimple" } } */
+}
+
+void
+f2 (int sc2, struct S ag2, int *pt2)
+{
+  char ar2[N];
+  foo (ar2);
+  #pragma omp target firstprivate (sc2, ar2, ag2, pt2) defaultmap (none)
+  bar (sc2, ar2, ag2, pt2);
+/* { dg-final { scan-tree-dump "firstprivate\\(sc2\\)" "gimple" } } */
+/* { dg-final { scan-tree-dump "firstprivate\\(ar2\\)" "gimple" } } */
+/* { dg-final { scan-tree-dump "firstprivate\\(ag2\\)" "gimple" } } */
+/* { dg-final { scan-tree-dump "firstprivate\\(pt2\\)" "gimple" } } */
+}
+
+void
+f3 (int sc3, struct S ag3, int *pt3)
+{
+  char ar3[N];
+  foo (ar3);
+  #pragma omp target defaultmap(none:scalar) defaultmap(none:aggregate) \
+		     map (sc3, ar3, ag3, pt3) defaultmap(none:pointer)
+  bar (sc3, ar3, ag3, pt3);
+/* { dg-final { scan-tree-dump "map\\(tofrom:sc3" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(tofrom:ar3" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(tofrom:ag3" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(tofrom:pt3" "gimple" } } */
+}
+
+void
+f4 (int sc4, struct S ag4, int *pt4)
+{
+  char ar4[N];
+  foo (ar4);
+  #pragma omp target defaultmap(tofrom:scalar)
+  bar (sc4, ar4, ag4, pt4);
+/* { dg-final { scan-tree-dump "map\\(tofrom:sc4" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(tofrom:ar4" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(tofrom:ag4" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(firstprivate:pt4 .pointer assign" "gimple" } } */
+}
+
+void
+f5 (int sc5, struct S ag5, int *pt5)
+{
+  char ar5[N];
+  foo (ar5);
+  #pragma omp target defaultmap(to)
+  bar (sc5, ar5, ag5, pt5);
+/* { dg-final { scan-tree-dump "map\\(to:sc5" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(to:ar5" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(to:ag5" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(to:pt5" "gimple" } } */
+}
+
+void
+f6 (int sc6, struct S ag6, int *pt6)
+{
+  char ar6[N];
+  foo (ar6);
+  #pragma omp target defaultmap(firstprivate)
+  bar (sc6, ar6, ag6, pt6);
+/* { dg-final { scan-tree-dump "firstprivate\\(sc6\\)" "gimple" } } */
+/* { dg-final { scan-tree-dump "firstprivate\\(ar6\\)" "gimple" } } */
+/* { dg-final { scan-tree-dump "firstprivate\\(ag6\\)" "gimple" } } */
+/* { dg-final { scan-tree-dump "firstprivate\\(pt6\\)" "gimple" } } */
+}
+
+void
+f7 (int sc7, struct S ag7, int *pt7)
+{
+  char ar7[N];
+  foo (ar7);
+  #pragma omp target defaultmap(alloc: scalar) defaultmap(from: aggregate) defaultmap(default: pointer)
+  {
+    int *q = &sc7;
+    *q = 6;
+    ag7.s = 5;
+    int i;
+    for (i = 0; i < N; ++i)
+      ar7[i] = 7;
+    bar (sc7, ar7, ag7, pt7);
+  }
+/* { dg-final { scan-tree-dump "map\\(alloc:sc7" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(from:ar7" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(from:ag7" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(firstprivate:pt7 .pointer assign" "gimple" } } */
+}
+
+void
+f8 (int sc8, struct S ag8, int *pt8)
+{
+  char ar8[N];
+  foo (ar8);
+  #pragma omp target defaultmap(firstprivate:aggregate) defaultmap(none:scalar) \
+		     defaultmap(tofrom:pointer) map(to: sc8)
+  bar (sc8, ar8, ag8, pt8);
+/* { dg-final { scan-tree-dump "map\\(to:sc8" "gimple" } } */
+/* { dg-final { scan-tree-dump "firstprivate\\(ar8\\)" "gimple" } } */
+/* { dg-final { scan-tree-dump "firstprivate\\(ag8\\)" "gimple" } } */
+/* { dg-final { scan-tree-dump "map\\(tofrom:pt8" "gimple" } } */
+}
+
+void
+f9 (int sc9, struct S ag9)
+{
+  char ar9[sc9 + 2];
+  foo (ar9);
+  #pragma omp target defaultmap(none) map(to: ar9, ag9) firstprivate (sc9)
+  bar (sc9, ar9, ag9, &sc9);
+}
--- gcc/testsuite/c-c++-common/gomp/defaultmap-3.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/defaultmap-3.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,34 @@ 
+/* { dg-do compile } */
+
+struct S { int s; };
+void foo (char *);
+void bar (int, char *, struct S, int *);
+#pragma omp declare target to (bar)
+#define N 16
+
+void
+f1 (int sc1, struct S ag1, int *pt1)
+{
+  char ar1[N];
+  foo (ar1);
+  #pragma omp target defaultmap(default:scalar) defaultmap(to:aggregate) defaultmap(none:pointer)	/* { dg-error "enclosing 'target'" } */
+  bar (sc1, ar1, ag1, pt1);	/* { dg-error "'pt1' not specified in enclosing 'target'" } */
+}
+
+void
+f2 (int sc2, struct S ag2, int *pt2)
+{
+  char ar2[N];
+  foo (ar2);
+  #pragma omp target defaultmap(none:scalar) defaultmap(from:aggregate) defaultmap(default:pointer)	/* { dg-error "enclosing 'target'" } */
+  bar (sc2, ar2, ag2, pt2);	/* { dg-error "'sc2' not specified in enclosing 'target'" } */
+}
+
+void
+f3 (int sc3, struct S ag3, int *pt3)
+{
+  char ar3[N];
+  foo (ar3);
+  #pragma omp target defaultmap(firstprivate:scalar) defaultmap(none:aggregate) defaultmap(to:pointer)	/* { dg-error "enclosing 'target'" } */
+  bar (sc3, ar3, ag3, pt3);	/* { dg-error "'ar3' not specified in enclosing 'target'" } */
+}				/* { dg-error "'ag3' not specified in enclosing 'target'" "" { target *-*-* } .-1 } */
--- gcc/testsuite/c-c++-common/gomp/depend-5.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/depend-5.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,48 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+struct T { int c[3]; };
+struct S { int a; struct T *b; struct T g; };
+struct S d[10];
+struct S *e[10];
+struct S *f;
+struct S h;
+
+void
+foo (void)
+{
+  #pragma omp task depend(inout: d)
+  ;
+  #pragma omp task depend(out: d[2])
+  ;
+  #pragma omp task depend(in: d[:])
+  ;
+  #pragma omp task depend(in: d[2:2])
+  ;
+  #pragma omp task depend(in: d[:2])
+  ;
+  #pragma omp task depend(inout: d[1].b->c[2])
+  ;
+  #pragma omp task depend(out: d[0].a)
+  ;
+  #pragma omp task depend(in: e[3]->a)
+  ;
+  #pragma omp task depend(inout: e[2]->b->c)
+  ;
+  #pragma omp task depend(in: e[1]->b->c[2])
+  ;
+  #pragma omp task depend(out: (*f).a)
+  ;
+  #pragma omp task depend(inout: f->b->c[0])
+  ;
+  #pragma omp task depend(in: f)
+  ;
+  #pragma omp task depend(out: *f)
+  ;
+  #pragma omp task depend(inout: f[0])
+  ;
+  #pragma omp task depend(in: f[0].a)
+  ;
+  #pragma omp task depend(inout: h.g.c[2])
+  ;
+}
--- gcc/testsuite/c-c++-common/gomp/depend-6.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/depend-6.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,36 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+struct T { int c[3]; };
+struct S { int a; struct T *b; struct T g; };
+struct U { int a : 5; };
+struct S d[10];
+struct S *e[10];
+struct S *f;
+struct S h;
+struct U i;
+
+void
+foo (void)
+{
+  #pragma omp task depend(in: d[:2].b->c[2])	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend(inout: d[1:].b->c[2])	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend(out: d[0:1].a)	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend(in: e[3:2]->a)	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend(inout: e[2:2]->b->c)	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend(in: e[1]->b->c[2:1])	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend(out: f + 0)		/* { dg-error "not lvalue expression" } */
+  ;
+  #pragma omp task depend(inout: f[0:1].a)	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend(inout: h.g.c[2:1])	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend(in: i.a)		/* { dg-error "bit-field '\[^\n\r]*' in 'depend' clause" } */
+  ;
+}
--- gcc/testsuite/c-c++-common/gomp/depend-iterator-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/depend-iterator-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,75 @@ 
+int arr[64], arr2[64];
+struct S { int a[4]; } k;
+short arr4[4];
+volatile int v;
+#define TEST_EQ(x,y) ({ int o[x == y ? 1 : -1]; 0; })
+
+void
+foo (unsigned char i, signed char j)
+{
+  #pragma omp task depend (iterator (j=6:2:-2) , out : \
+	arr[TEST_EQ (sizeof (j), sizeof (int)), \
+	    TEST_EQ (sizeof (i), sizeof (unsigned char)), \
+	    TEST_EQ (sizeof (k), sizeof (struct S)), j], \
+	arr2[TEST_EQ (((__typeof (j)) -1) < 0, 1), \
+	     TEST_EQ (((__typeof (i)) -1) < 0, 0), \
+	     TEST_EQ (((__typeof (k.a[0])) -1) < 0, 1), j]) \
+	depend(out: arr[0]) \
+	depend (iterator (long long i=__LONG_LONG_MAX__ - 4:__LONG_LONG_MAX__ - 2:2, \
+			  unsigned short j=~0U-16:~0U-8:3, \
+			  short *k=&arr4[1]:&arr4[2]:1) , in : \
+	arr[TEST_EQ (sizeof (i), sizeof (long long)), \
+	    TEST_EQ (sizeof (j), sizeof (unsigned short)), \
+	    TEST_EQ (sizeof (k), sizeof (short *)), \
+	    TEST_EQ (sizeof (*k), sizeof (short)), i - __LONG_LONG_MAX__ + 4], \
+	arr2[TEST_EQ (((__typeof (i)) -1) < 0, 1), \
+	     TEST_EQ (((__typeof (j)) -1) < 0, 0), \
+	     TEST_EQ (((__typeof (*k)) -1) < 0, 1), j - (~0U-16)], \
+	arr2[k - &arr4[0]]) \
+	depend(in : k)
+    v++;
+}
+
+void
+bar (unsigned char i, signed char j)
+{
+  int m = j;
+  int n = j + 2;
+  #pragma omp task depend (iterator (j=6:2:m) , out : \
+	arr[TEST_EQ (sizeof (j), sizeof (int)), \
+	    TEST_EQ (sizeof (i), sizeof (unsigned char)), \
+	    TEST_EQ (sizeof (k), sizeof (struct S)), j], \
+	arr2[TEST_EQ (((__typeof (j)) -1) < 0, 1), \
+	     TEST_EQ (((__typeof (i)) -1) < 0, 0), \
+	     TEST_EQ (((__typeof (k.a[0])) -1) < 0, 1), j]) \
+	depend(out: arr[0]) \
+	depend (iterator (long long i=__LONG_LONG_MAX__ - 4 - n:__LONG_LONG_MAX__ - 2:2, \
+			  unsigned short j=~0U-16:~0U-8-n:3, \
+			  short *k=&arr4[1]:&arr4[n + 2]:1) , in : \
+	arr[TEST_EQ (sizeof (i), sizeof (long long)), \
+	    TEST_EQ (sizeof (j), sizeof (unsigned short)), \
+	    TEST_EQ (sizeof (k), sizeof (short *)), \
+	    TEST_EQ (sizeof (*k), sizeof (short)), i - __LONG_LONG_MAX__ + 4], \
+	arr2[TEST_EQ (((__typeof (i)) -1) < 0, 1), \
+	     TEST_EQ (((__typeof (j)) -1) < 0, 0), \
+	     TEST_EQ (((__typeof (*k)) -1) < 0, 1), j - (~0U-16)], \
+	arr2[k - &arr4[0]:10]) \
+	depend(in : k)
+    v++;
+}
+
+void
+baz (void)
+{
+  #pragma omp parallel
+  #pragma omp master
+  {
+    #pragma omp task depend(iterator(unsigned long int k = 0 : 2) , inout : \
+	arr[TEST_EQ (sizeof (k), sizeof (unsigned long)), \
+	    TEST_EQ (((__typeof (k)) -1) < 0, 0), k]) \
+	depend(iterator(signed char s = -3 : -12 : -1) , out : \
+	arr[TEST_EQ (sizeof (s), sizeof (signed char)), \
+	    TEST_EQ (((__typeof (s)) -1) < 0, 1), s + 12])
+      v++;
+  }
+}
--- gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,97 @@ 
+int a, b[64];
+struct S { int c; } *d, *e;
+struct T;
+struct T *f, *g;
+int *h;
+
+void
+f1 (void)
+{
+  #pragma omp task depend (iterator , in : a)	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend (iterator (for = 0 : 2) , in : a)	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend (iterator (5 = 0 : 2) , in : a)	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend (iterator (i : 0 : 2) , in : a)	/* { dg-error "expected '='|name a type|expected" } */
+  ;
+  #pragma omp task depend (iterator (i = 0, 1 : 2) , in : a)	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend (iterator (i = (0, 1) : 2) , in : a)
+  ;
+  #pragma omp task depend (iterator (i = 0 : 1 : 2 : 3) , in : a)	/* { dg-error "expected '.'" } */
+  ;
+  #pragma omp task depend (iterator (i = 0 : 2, 3) , in : a)	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend (iterator (i = 0 : 10 : 2, 3) , in : a)	/* { dg-error "expected" } */
+  ;
+  #pragma omp task depend (iterator (i = 0:1), iterator (j = 0:1) , in : a)	/* { dg-error "invalid depend kind" } */
+  ;
+  #pragma omp task depend (iterator (i = 0:32) , in : b[i*2:2])
+  ;
+  #pragma omp task depend (iterator (struct S i = 0:1), in : a)		/* { dg-error "iterator 'i' has neither integral nor pointer type" } */
+  ;
+  #pragma omp task depend (iterator (void i = 0:1) , in : a)		/* { dg-error "iterator 'i' has neither integral nor pointer type" } */
+  ;
+  #pragma omp task depend (iterator (float f = 0.2:0.4) , in : a)	/* { dg-error "iterator 'f' has neither integral nor pointer type" } */
+  ;
+  #pragma omp task depend (iterator (struct S *p = d:e:2) , in : a)
+  ;
+  #pragma omp task depend (iterator (struct T *p = f:g) , in : a)	/* { dg-error "invalid use of" } */
+  ;
+  #pragma omp task depend (iterator (int i = 0:4, \
+				     struct U { int (*p)[i + 2]; } *p = 0:2) , in : a)	/* { dg-error "type of iterator 'p' refers to outer iterator 'i'" "" { target c } } */
+  ;									/* { dg-error "types may not be defined in iterator type|not an integer constant" "" { target c++ } .-1 } */
+  #pragma omp task depend (iterator (i = 0:4, j = i:16) , in : a)	/* { dg-error "begin expression refers to outer iterator 'i'" } */
+  ;
+  #pragma omp task depend (iterator (i = 0:4, j = 2:i:1) , in : a)	/* { dg-error "end expression refers to outer iterator 'i'" } */
+  ;
+  #pragma omp task depend (iterator (i = 0:4, j = 2:8:i) , in : a)	/* { dg-error "step expression refers to outer iterator 'i'" } */
+  ;
+  #pragma omp task depend (iterator (i = *d:2) , in : a)	/* { dg-error "aggregate value used where an integer was expected" "" { target c } } */
+  ;								/* { dg-error "invalid cast from type 'S' to type 'int'" "" { target c++ } .-1 } */
+  #pragma omp task depend (iterator (i = 2:*d:2) , in : a)	/* { dg-error "aggregate value used where an integer was expected" "" { target c } } */
+  ;								/* { dg-error "invalid cast from type 'S' to type 'int'" "" { target c++ } .-1 } */
+  #pragma omp task depend (iterator (i = 2:4:*d) , in : a)	/* { dg-error "iterator step with non-integral type" } */
+  ;
+  #pragma omp task depend (iterator (i = 1.25:2.5:3) , in : a)
+  ;
+  #pragma omp task depend (iterator (i = 1:2:3.5) , in : a)	/* { dg-error "iterator step with non-integral type" } */
+  ;
+  #pragma omp task depend (iterator (int *p = 23 : h) , in : a)
+  ;
+  #pragma omp task depend (iterator (short i=1:3:0) , in : a)	/* { dg-error "iterator 'i' has zero step" } */
+  ;
+  #pragma omp task depend (iterator (i = 1 : 3 : 3 - 3) , in : a)	/* { dg-error "iterator 'i' has zero step" } */
+  ;
+  #pragma omp task depend (iterator (int *p = &b[6]:&b[9]:4 - 4) , in : a)	/* { dg-error "iterator 'p' has zero step" } */
+  ;
+  #pragma omp task depend (iterator (const int i = 0 : 2) , in : a)	/* { dg-error "const qualified" } */
+  ;
+  #pragma omp task depend (iterator (const long long unsigned i = 0 : 2) , in : a)	/* { dg-error "const qualified" } */
+  ;
+#if !defined (__cplusplus) && __STDC_VERSION__ >= 201112L
+  #pragma omp task depend (iterator (_Atomic unsigned i = 0 : 2) , in : a)	/* { dg-error "_Atomic" "" { target c } } */
+  ;
+#endif
+}
+
+void
+f2 (void)
+{
+  int i, j;
+  #pragma omp for ordered(2)
+  for (i = 0; i < 64; i++)
+    for (j = 0; j < 64; j++)
+      {
+      #pragma omp ordered depend (iterator (k=0:1) , sink: i - 1, j - 1)	/* { dg-error "'iterator' modifier incompatible with 'sink'" } */
+      #pragma omp ordered depend (iterator (int l = 0:2:3) , source)		/* { dg-error "'iterator' modifier incompatible with 'source'" } */
+      }
+}
+
+void
+f3 (void)
+{
+  #pragma omp task depend (iterator (i = 0:1), iterator (j = 0:1) , in : a)	/* { dg-error "invalid depend kind" } */
+  ;
+}
--- gcc/testsuite/c-c++-common/gomp/depobj-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/depobj-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,63 @@ 
+typedef struct __attribute__((__aligned__ (sizeof (void *)))) omp_depend_t {
+  char __omp_depend_t__[2 * sizeof (void *)];
+} omp_depend_t;
+
+omp_depend_t bar (void);
+extern const omp_depend_t cdepobj;
+extern omp_depend_t depobj;
+extern omp_depend_t depobja[4];
+extern omp_depend_t *pdepobj;
+int a, b, i, j;
+
+void
+f1 (void)
+{
+  #pragma omp depobj(depobj) depend(in : a)
+  #pragma omp depobj(depobj) update(inout)
+  #pragma omp task depend (depobj: depobj)
+  ;
+  #pragma omp depobj(depobj) destroy
+  #pragma omp task depend (iterator (i=1:3) , depobj: *(depobja + i))
+  ;
+  #pragma omp depobj(pdepobj[0]) depend(mutexinoutset:a)
+  #pragma omp depobj(*pdepobj) destroy
+}
+
+void
+f2 (void)
+{
+  omp_depend_t depobjb[4];
+  #pragma omp depobj					/* { dg-error "expected" } */
+  #pragma omp depobj destroy				/* { dg-error "expected" } */
+  #pragma omp depobj (depobj)				/* { dg-error "expected 'depend', 'destroy' or 'update' clause" } */
+  #pragma omp depobj (depobj) foobar			/* { dg-error "expected 'depend', 'destroy' or 'update' clause" } */
+  #pragma omp depobj(bar ()) update(inout)		/* { dg-error "'depobj' expression is not lvalue expression" } */
+  #pragma omp depobj (cdepobj) update(in)		/* { dg-error "'const' qualified 'depobj' expression" } */
+  #pragma omp depobj (depobjb) depend(in: a)		/* { dg-error "type of 'depobj' expression is not 'omp_depend_t'" } */
+  #pragma omp depobj (pdepobj) depend(in: a)		/* { dg-error "type of 'depobj' expression is not 'omp_depend_t'" } */
+  #pragma omp depobj (a) destroy			/* { dg-error "type of 'depobj' expression is not 'omp_depend_t'" } */
+  #pragma omp depobj (depobj) depend(depobj:a)		/* { dg-error "does not have 'omp_depend_t' type in 'depend' clause with 'depobj' dependence type" } */
+  #pragma omp depobj (depobj) depend(depobj:*depobjb)	/* { dg-error "'depobj' dependence type specified in 'depend' clause on 'depobj' construct" } */
+  #pragma omp depobj (depobj) update(foobar)		/* { dg-error "expected 'in', 'out', 'inout' or 'mutexinoutset'" } */
+  #pragma omp depobj (depobj) depend(in: *depobja)	/* { dg-error "should not have 'omp_depend_t' type in 'depend' clause with dependence type" } */
+  #pragma omp depobj (depobj) depend(in: a) depend(in: b)	/* { dg-error "expected" } */
+  #pragma omp depobj (depobj) depend(in: a) update(out)	/* { dg-error "expected" } */
+  #pragma omp depobj (depobj) depend(in: a, b)		/* { dg-error "more than one locator in 'depend' clause on 'depobj' construct" } */
+  #pragma omp depobj (depobj) depend(source)		/* { dg-error "'depend\\(source\\)' is only allowed in 'omp ordered'" } */
+  #pragma omp depobj (depobj) depend(sink: i + 1, j - 1)	/* { dg-error "'depend\\(sink\\)' is only allowed in 'omp ordered'" } */
+  #pragma omp depobj (depobj) depend(iterator (i = 0:2) , in : a)	/* { dg-error "'iterator' modifier may not be specified on 'depobj' construct" } */
+  if (0)
+    #pragma omp depobj (depobj) destroy			/* { dg-error "'#pragma omp depobj' may only be used in compound statements" } */
+    ;
+}
+
+void
+f3 (void)
+{
+  #pragma omp task depend (depobj: depobja[1:2])	/* { dg-error "'depend' clause with 'depobj' dependence type on array section" } */
+  ;
+  #pragma omp task depend (depobj: a)			/* { dg-error "'a' does not have 'omp_depend_t' type in 'depend' clause with 'depobj' dependence type" } */
+  ;
+  #pragma omp task depend (in: depobj)			/* { dg-error "'depobj' should not have 'omp_depend_t' type in 'depend' clause with dependence type" } */
+  ;
+}
--- gcc/testsuite/c-c++-common/gomp/flush-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/flush-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,39 @@ 
+/* { dg-additional-options "-fdump-tree-gimple" } */
+/* { dg-final { scan-tree-dump "foo \\(4\\);\[\n\r]*  __atomic_thread_fence \\(4\\);\[\n\r]*  foo \\(4\\);" "gimple" } } */
+/* { dg-final { scan-tree-dump "foo \\(3\\);\[\n\r]*  __atomic_thread_fence \\(3\\);\[\n\r]*  foo \\(3\\);" "gimple" } } */
+/* { dg-final { scan-tree-dump "foo \\(2\\);\[\n\r]*  __atomic_thread_fence \\(2\\);\[\n\r]*  foo \\(2\\);" "gimple" } } */
+/* { dg-final { scan-tree-dump "foo \\(5\\);\[\n\r]*  __sync_synchronize \\(\\);\[\n\r]*  foo \\(5\\);" "gimple" } } */
+
+void foo (int);
+
+void
+f1 (void)
+{
+  foo (4);
+  #pragma omp flush acq_rel
+  foo (4);
+}
+
+void
+f2 (void)
+{
+  foo (3);
+  #pragma omp flush release
+  foo (3);
+}
+
+void
+f3 (void)
+{
+  foo (2);
+  #pragma omp flush acquire
+  foo (2);
+}
+
+void
+f4 (void)
+{
+  foo (5);
+  #pragma omp flush
+  foo (5);
+}
--- gcc/testsuite/c-c++-common/gomp/flush-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/flush-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,17 @@ 
+int a, b;
+
+void
+foo (void)
+{
+  #pragma omp flush
+  #pragma omp flush (a, b)
+  #pragma omp flush acquire
+  #pragma omp flush release
+  #pragma omp flush acq_rel
+  #pragma omp flush relaxed		/* { dg-error "expected 'acq_rel', 'release' or 'acquire'" } */
+  #pragma omp flush seq_cst		/* { dg-error "expected 'acq_rel', 'release' or 'acquire'" } */
+  #pragma omp flush foobar		/* { dg-error "expected 'acq_rel', 'release' or 'acquire'" } */
+  #pragma omp flush acquire (a, b)	/* { dg-error "'flush' list specified together with memory order clause" } */
+  #pragma omp flush release (a, b)	/* { dg-error "'flush' list specified together with memory order clause" } */
+  #pragma omp flush acq_rel (a, b)	/* { dg-error "'flush' list specified together with memory order clause" } */
+}
--- gcc/testsuite/c-c++-common/gomp/for-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/for-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,60 @@ 
+void bar (int);
+
+int a[256];
+
+void
+foo (void)
+{
+  int i;
+  #pragma omp for
+  for (i = 0; i != 64; i++)
+    bar (i);
+  #pragma omp for
+  for (i = 128; i != 64; i--)
+    bar (i);
+  #pragma omp for
+  for (i = 0; i != 64; i = i + 1)
+    bar (i);
+  #pragma omp for
+  for (i = 128; i != 64; i = i - 1)
+    bar (i);
+  #pragma omp for
+  for (i = 0; i != 64; i = 1 + i)
+    bar (i);
+  #pragma omp for
+  for (i = 128; i != 64; i = -1 + i)
+    bar (i);
+  #pragma omp for
+  for (i = 0; i != 64; i += 1)
+    bar (i);
+  #pragma omp for
+  for (i = 128; i != 64; i -= 1)
+    bar (i);
+  #pragma omp single
+  {
+    #pragma omp simd
+    for (i = 0; i != 64; i++)
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 128; i != 64; i--)
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 0; i != 64; i = i + 1)
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 128; i != 64; i = i - 1)
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 0; i != 64; i = 1 + i)
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 128; i != 64; i = -1 + i)
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 0; i != 64; i += 1)
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 128; i != 64; i -= 1)
+      a[i] = a[i] + 1;
+  }
+}
--- gcc/testsuite/c-c++-common/gomp/for-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/for-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,31 @@ 
+void bar (short *);
+
+void
+foo (short *q, short *r, short *s)
+{
+  short *p;
+  #pragma omp for
+  for (p = q; p != r; p++)
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p--)
+    bar (p);
+  #pragma omp for
+  for (p = q; p != r; p = p + 1)
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p = p - 1)
+    bar (p);
+  #pragma omp for
+  for (p = q; p != r; p = 1 + p)
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p = -1 + p)
+    bar (p);
+  #pragma omp for
+  for (p = q; p != r; p += 1)
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p -= 1)
+    bar (p);
+}
--- gcc/testsuite/c-c++-common/gomp/for-3.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/for-3.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,48 @@ 
+void bar (int);
+
+int a[256];
+
+void
+foo (int j)
+{
+  int i;
+  #pragma omp for
+  for (i = 0; i != 64; i = i + 4)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (i);
+  #pragma omp for
+  for (i = 128; i != 64; i = i - 4)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (i);
+  #pragma omp for
+  for (i = 0; i != 64; i = j + i)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (i);
+  #pragma omp for
+  for (i = 128; i != 64; i = -16 + i)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (i);
+  #pragma omp for
+  for (i = 0; i != 64; i += j)		/* { dg-error "increment is not constant 1 or -1" } */
+    bar (i);
+  #pragma omp for
+  for (i = 128; i != 64; i -= 8)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (i);
+  #pragma omp single
+  {
+    #pragma omp simd
+    for (i = 0; i != 64; i = i + 16)	/* { dg-error "increment is not constant 1 or -1" } */
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 128; i != 64; i = i - 2)	/* { dg-error "increment is not constant 1 or -1" } */
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 0; i != 64; i = j + i)	/* { dg-error "increment is not constant 1 or -1" } */
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 128; i != 64; i = -j + i)	/* { dg-error "increment is not constant 1 or -1" } */
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 0; i != 64; i += 8)	/* { dg-error "increment is not constant 1 or -1" } */
+      a[i] = a[i] + 1;
+    #pragma omp simd
+    for (i = 128; i != 64; i -= j)	/* { dg-error "increment is not constant 1 or -1" } */
+      a[i] = a[i] + 1;
+  }
+}
--- gcc/testsuite/c-c++-common/gomp/for-4.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/for-4.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,25 @@ 
+void bar (short *);
+
+void
+foo (short *q, short *r, short *s, long t)
+{
+  short *p;
+  #pragma omp for
+  for (p = q; p != r; p = p + 5)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p = p - 2)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = q; p != r; p = t + p)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p = -t + p)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = q; p != r; p += t)		/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p -= 7)		/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+}
--- gcc/testsuite/c-c++-common/gomp/for-5.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/for-5.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,50 @@ 
+// { dg-options "-fopenmp" }
+
+void bar (void *);
+
+__attribute__((noinline, noclone)) void
+foo (void *qx, void *rx, void *sx, int n)
+{
+  unsigned short (*q)[n], (*r)[n], (*s)[n], (*p)[n];
+  q = (typeof (q)) qx;
+  r = (typeof (r)) rx;
+  s = (typeof (s)) sx;
+  int t = 1;
+  int o = -1;
+  #pragma omp for
+  for (p = q; p != r; p += t)		/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p += o)		/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = q; p != r; p = p + t)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p = p + o)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = q; p != r; p = t + p)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p = o + p)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = q; p != r; p += 2)		/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p -= 2)		/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = q; p != r; p = p + 3)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p = p - 3)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = q; p != r; p = 4 + p)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+  #pragma omp for
+  for (p = s; p != r; p = -5 + p)	/* { dg-error "increment is not constant 1 or -1" } */
+    bar (p);
+}
--- gcc/testsuite/c-c++-common/gomp/for-6.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/for-6.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,16 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (int n)
+{
+  int i;
+
+  #pragma omp for schedule(monotonic:runtime)
+  for (i = 0; i < n; ++i)
+    bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_loop_runtime_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_runtime_next" 1 "ompexp" } } */
--- gcc/testsuite/c-c++-common/gomp/for-7.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/for-7.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,16 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (int n)
+{
+  int i;
+
+  #pragma omp for schedule(nonmonotonic:runtime)
+  for (i = 0; i < n; ++i)
+    bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_loop_nonmonotonic_runtime_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_nonmonotonic_runtime_next" 1 "ompexp" } } */
--- gcc/testsuite/c-c++-common/gomp/if-1.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/c-c++-common/gomp/if-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -14,6 +14,12 @@  foo (int a, int b, int *p, int *q)
   #pragma omp parallel for simd if (parallel : a)
   for (i = 0; i < 16; i++)
     ;
+  #pragma omp parallel for simd if (simd : a)
+  for (i = 0; i < 16; i++)
+    ;
+  #pragma omp parallel for simd if (simd : a) if (parallel:b)
+  for (i = 0; i < 16; i++)
+    ;
   #pragma omp task if (a)
     ;
   #pragma omp task if (task: a)
@@ -24,16 +30,37 @@  foo (int a, int b, int *p, int *q)
   #pragma omp taskloop if (taskloop : a)
   for (i = 0; i < 16; i++)
     ;
+  #pragma omp taskloop simd if (a)
+  for (i = 0; i < 16; i++)
+    ;
+  #pragma omp taskloop simd if (taskloop : a)
+  for (i = 0; i < 16; i++)
+    ;
+  #pragma omp taskloop simd if (simd : a)
+  for (i = 0; i < 16; i++)
+    ;
+  #pragma omp taskloop simd if (taskloop:b) if (simd : a)
+  for (i = 0; i < 16; i++)
+    ;
   #pragma omp target if (a)
     ;
   #pragma omp target if (target: a)
     ;
+  #pragma omp target simd if (a)
+  for (i = 0; i < 16; i++)
+    ;
+  #pragma omp target simd if (simd : a) if (target: b)
+  for (i = 0; i < 16; i++)
+    ;
   #pragma omp target teams distribute parallel for simd if (a)
   for (i = 0; i < 16; i++)
     ;
   #pragma omp target teams distribute parallel for simd if (parallel : a) if (target: b)
   for (i = 0; i < 16; i++)
     ;
+  #pragma omp target teams distribute parallel for simd if (simd : a) if (target: b)
+  for (i = 0; i < 16; i++)
+    ;
   #pragma omp target data if (a) map (p[0:2])
     ;
   #pragma omp target data if (target data: a) map (p[0:2])
@@ -44,4 +71,47 @@  foo (int a, int b, int *p, int *q)
   #pragma omp target exit data if (target exit data: a) map (from: p[0:2])
   #pragma omp target update if (a) to (q[0:3])
   #pragma omp target update if (target update:a) to (q[0:3])
+  #pragma omp parallel
+  {
+    #pragma omp cancel parallel if (a)
+  }
+ #pragma omp parallel
+  {
+    #pragma omp cancel parallel if (cancel:a)
+  }
+  #pragma omp for
+  for (i = 0; i < 16; i++)
+    {
+      #pragma omp cancel for if (a)
+    }
+  #pragma omp for
+  for (i = 0; i < 16; i++)
+    {
+      #pragma omp cancel for if (cancel: a)
+    }
+  #pragma omp sections
+    {
+    #pragma omp section
+      {
+	#pragma omp cancel sections if (a)
+      }
+    }
+  #pragma omp sections
+    {
+    #pragma omp section
+      {
+	#pragma omp cancel sections if (cancel: a)
+      }
+    }
+  #pragma omp taskgroup
+  {
+    #pragma omp task
+    {
+      #pragma omp cancel taskgroup if (a)
+    }
+    #pragma omp task
+    {
+      #pragma omp cancel taskgroup if (cancel: a)
+    }
+  }
 }
--- gcc/testsuite/c-c++-common/gomp/if-2.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/c-c++-common/gomp/if-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -18,6 +18,8 @@  foo (int a, int b, int *p, int *q, int t
     ;
   #pragma omp parallel if (target update:a) /* { dg-error "expected .parallel. .if. clause modifier rather than .target update." } */
     ;
+  #pragma omp parallel if (cancel:a) /* { dg-error "expected .parallel. .if. clause modifier rather than .cancel." } */
+    ;
   #pragma omp parallel for simd if (target update: a) /* { dg-error "expected .parallel. .if. clause modifier rather than .target update." } */
   for (i = 0; i < 16; i++)
     ;
@@ -27,12 +29,15 @@  foo (int a, int b, int *p, int *q, int t
     ;
   #pragma omp task if (parallel: a) /* { dg-error "expected .task. .if. clause modifier rather than .parallel." } */
     ;
+  #pragma omp simd if (cancel: a) /* { dg-error "expected .simd. .if. clause modifier rather than .cancel." } */
+  for (i = 0; i < 16; i++)
+    ;
   #pragma omp taskloop if (task : a) /* { dg-error "expected .taskloop. .if. clause modifier rather than .task." } */
   for (i = 0; i < 16; i++)
     ;
   #pragma omp target if (taskloop: a) /* { dg-error "expected .target. .if. clause modifier rather than .taskloop." } */
     ;
-  #pragma omp target teams distribute parallel for simd if (target exit data : a) /* { dg-error "expected .parallel. or .target. .if. clause modifier" } */
+  #pragma omp target teams distribute parallel for simd if (target exit data : a) /* { dg-error "expected .target. .if. clause modifier" } */
   for (i = 0; i < 16; i++)
     ;
   #pragma omp target data if (target: a) map (p[0:2]) /* { dg-error "expected .target data. .if. clause modifier rather than .target." } */
@@ -40,4 +45,9 @@  foo (int a, int b, int *p, int *q, int t
   #pragma omp target enter data if (target data: a) map (to: p[0:2]) /* { dg-error "expected .target enter data. .if. clause modifier rather than .target data." } */
   #pragma omp target exit data if (target enter data: a) map (from: p[0:2]) /* { dg-error "expected .target exit data. .if. clause modifier rather than .target enter data." } */
   #pragma omp target update if (target exit data:a) to (q[0:3]) /* { dg-error "expected .target update. .if. clause modifier rather than .target exit data." } */
+  #pragma omp for
+  for (i = 0; i < 16; i++)
+    {
+      #pragma omp cancel for if (target exit data:a) /* { dg-error "expected .cancel. .if. clause modifier" } */
+    }
 }
--- gcc/testsuite/c-c++-common/gomp/if-3.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/if-3.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-additional-options "-O2" } */
+
+#define N 1024
+
+void
+foo (int *x, int *y, int *z, int a)
+{
+  int i;
+  #pragma omp simd if (simd: a > 2) aligned (x, y, z : 16)
+  for (i = 0; i < N; i++)
+    x[i] = y[i] + z[i];
+}
--- gcc/testsuite/c-c++-common/gomp/master-combined-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/master-combined-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,32 @@ 
+void bar (int *);
+
+void
+foo (int *a)
+{
+  int i, j, k, u = 0, v = 0, w = 0, x = 0, y = 0, z = 0;
+  #pragma omp parallel master default(none) private (k)
+  bar (&k);
+  #pragma omp parallel default(none) firstprivate(a) shared(x, y, z)
+  {
+    #pragma omp master taskloop reduction (+:x) default(none) firstprivate(a)
+    for (i = 0; i < 64; i++)
+      x += a[i];
+    #pragma omp master taskloop simd reduction (+:y) default(none) firstprivate(a) private (i)
+    for (i = 0; i < 64; i++)
+      y += a[i];
+    #pragma omp master taskloop simd collapse(2) reduction (+:z) default(none) firstprivate(a) private (i, j)
+    for (j = 0; j < 1; j++)
+      for (i = 0; i < 64; ++i)
+	z += a[i];
+  }
+  #pragma omp parallel master taskloop reduction (+:u) default(none) firstprivate(a)
+  for (i = 0; i < 64; i++)
+    u += a[i];
+  #pragma omp parallel master taskloop simd reduction (+:v) default(none) firstprivate(a)
+  for (i = 0; i < 64; i++)
+    v += a[i];
+  #pragma omp parallel master taskloop simd collapse(2) reduction (+:w) default(none) firstprivate(a)
+  for (j = 0; j < 1; j++)
+    for (i = 0; i < 64; ++i)
+      w += a[i];
+}
--- gcc/testsuite/c-c++-common/gomp/master-combined-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/master-combined-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,13 @@ 
+void
+foo (int *a)
+{
+  int i, r = 0, s = 0;
+  #pragma omp taskgroup task_reduction(+:r)
+  #pragma omp parallel master taskloop in_reduction(+:r)	/* { dg-error "'in_reduction' is not valid for '#pragma omp parallel master taskloop'" } */
+  for (i = 0; i < 64; i++)
+    r += a[i];
+  #pragma omp taskgroup task_reduction(+:s)
+  #pragma omp parallel master taskloop simd in_reduction(+:s)	/* { dg-error "'in_reduction' is not valid for '#pragma omp parallel master taskloop simd'" } */
+  for (i = 0; i < 64; i++)
+    s += a[i];
+}
--- gcc/testsuite/c-c++-common/gomp/nontemporal-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/nontemporal-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,17 @@ 
+/* { dg-do compile } */
+/* { dg-additional-options "-O2" } */
+
+#define N 1024
+int a[N], b[N], c[N], d[N];
+
+void
+foo (void)
+{
+  int i;
+  #pragma omp simd nontemporal (a, b)
+  for (i = 0; i < N; ++i)
+    a[i] = b[i] + c[i];
+  #pragma omp simd nontemporal (d)
+  for (i = 0; i < N; ++i)
+    d[i] = 2 * c[i];
+}
--- gcc/testsuite/c-c++-common/gomp/nontemporal-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/nontemporal-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,19 @@ 
+/* { dg-do compile } */
+
+#define N 1024
+extern int a[N], b[N], c[N], d[N];
+
+void
+foo (void)
+{
+  int i;
+  #pragma omp simd nontemporal (a, b) aligned (a, b, c)
+  for (i = 0; i < N; ++i)
+    a[i] = b[i] + c[i];
+  #pragma omp simd nontemporal (d) nontemporal (d)	/* { dg-error "'d' appears more than once in 'nontemporal' clauses" } */
+  for (i = 0; i < N; ++i)
+    d[i] = 2 * c[i];
+  #pragma omp simd nontemporal (a, b, b)		/* { dg-error "'b' appears more than once in 'nontemporal' clauses" } */
+  for (i = 0; i < N; ++i)
+    a[i] += b[i] + c[i];
+}
--- gcc/testsuite/c-c++-common/gomp/reduction-task-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/reduction-task-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,86 @@ 
+int v;
+extern void foo (int);
+
+void
+bar (void)
+{
+  int i;
+  #pragma omp for reduction (task, +: v)
+  for (i = 0; i < 64; i++)
+    foo (i);
+  #pragma omp sections reduction (task, +: v)
+  {
+    foo (-2);
+    #pragma omp section
+    foo (-3);
+  }
+  #pragma omp parallel reduction (task, +: v)
+  foo (-1);
+  #pragma omp parallel for reduction (task, +: v)
+  for (i = 0; i < 64; i++)
+    foo (i);
+  #pragma omp parallel sections reduction (task, +: v)
+  {
+    foo (-2);
+    #pragma omp section
+    foo (-3);
+  }
+  #pragma omp teams distribute parallel for reduction (task, +: v)
+  for (i = 0; i < 64; i++)
+    foo (i);
+  #pragma omp for reduction (default, +: v)
+  for (i = 0; i < 64; i++)
+    foo (i);
+  #pragma omp sections reduction (default, +: v)
+  {
+    foo (-2);
+    #pragma omp section
+    foo (-3);
+  }
+  #pragma omp parallel reduction (default, +: v)
+  foo (-1);
+  #pragma omp parallel for reduction (default, +: v)
+  for (i = 0; i < 64; i++)
+    foo (i);
+  #pragma omp parallel sections reduction (default, +: v)
+  {
+    foo (-2);
+    #pragma omp section
+    foo (-3);
+  }
+  #pragma omp teams distribute parallel for reduction (default, +: v)
+  for (i = 0; i < 64; i++)
+    foo (i);
+  #pragma omp for reduction (default, +: v) nowait
+  for (i = 0; i < 64; i++)
+    foo (i);
+  #pragma omp sections nowait reduction (default, +: v)
+  {
+    foo (-2);
+    #pragma omp section
+    foo (-3);
+  }
+  #pragma omp simd reduction (default, +: v)
+  for (i = 0; i < 64; i++)
+    v++;
+  #pragma omp for simd reduction (default, +: v)
+  for (i = 0; i < 64; i++)
+    v++;
+  #pragma omp parallel for simd reduction (default, +: v)
+  for (i = 0; i < 64; i++)
+    v++;
+  #pragma omp teams distribute parallel for simd reduction (default, +: v)
+  for (i = 0; i < 64; i++)
+    v++;
+  #pragma omp taskloop reduction (default, +: v)
+  for (i = 0; i < 64; i++)
+    foo (i);
+  #pragma omp taskloop simd reduction (default, +: v)
+  for (i = 0; i < 64; i++)
+    v++;
+  #pragma omp teams reduction (default, +: v)
+  foo (i);
+  #pragma omp teams distribute reduction (default, +: v)
+  for (i = 0; i < 64; i++)
+    foo (i);
+}
--- gcc/testsuite/c-c++-common/gomp/reduction-task-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/reduction-task-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,40 @@ 
+int v;
+extern void foo (int);
+
+void
+bar (void)
+{
+  int i;
+  #pragma omp for reduction (task, +: v) nowait	/* { dg-error "'task' reduction modifier on a construct with a 'nowait' clause" } */
+  for (i = 0; i < 64; i++)
+    foo (i);
+  #pragma omp sections nowait reduction (task, +: v)	/* { dg-error "'task' reduction modifier on a construct with a 'nowait' clause" } */
+  {
+    foo (-2);
+    #pragma omp section
+    foo (-3);
+  }
+  #pragma omp simd reduction (task, +: v)	/* { dg-error "invalid 'task' reduction modifier on construct other than 'parallel', 'for' or 'sections'" } */
+  for (i = 0; i < 64; i++)
+    v++;
+  #pragma omp for simd reduction (task, +: v)	/* { dg-error "invalid 'task' reduction modifier on construct combined with 'simd'" } */
+  for (i = 0; i < 64; i++)
+    v++;
+  #pragma omp parallel for simd reduction (task, +: v)	/* { dg-error "invalid 'task' reduction modifier on construct combined with 'simd'" } */
+  for (i = 0; i < 64; i++)
+    v++;
+  #pragma omp teams distribute parallel for simd reduction (task, +: v)	/* { dg-error "invalid 'task' reduction modifier on construct combined with 'simd'" } */
+  for (i = 0; i < 64; i++)
+    v++;
+  #pragma omp taskloop reduction (task, +: v)	/* { dg-error "invalid 'task' reduction modifier on construct other than 'parallel', 'for' or 'sections'" } */
+  for (i = 0; i < 64; i++)
+    foo (i);
+  #pragma omp taskloop simd reduction (task, +: v)	/* { dg-error "invalid 'task' reduction modifier on construct combined with 'simd'" } */
+  for (i = 0; i < 64; i++)
+    v++;
+  #pragma omp teams reduction (task, +: v)	/* { dg-error "invalid 'task' reduction modifier on construct other than 'parallel', 'for' or 'sections'" } */
+  foo (i);
+  #pragma omp teams distribute reduction (task, +: v)	/* { dg-error "invalid 'task' reduction modifier on construct not combined with 'parallel', 'for' or 'sections'" } */
+  for (i = 0; i < 64; i++)
+    foo (i);
+}
--- gcc/testsuite/c-c++-common/gomp/requires-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/requires-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,15 @@ 
+#pragma omp requires unified_address
+#pragma omp requires unified_shared_memory
+#pragma omp requires unified_shared_memory unified_address
+#pragma omp requires dynamic_allocators,reverse_offload
+
+int i;
+
+void
+foo ()
+{
+  if (0)
+    #pragma omp requires unified_shared_memory unified_address
+    i++;
+  #pragma omp requries atomic_default_mem_order(seq_cst)
+}
--- gcc/testsuite/c-c++-common/gomp/requires-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/requires-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,18 @@ 
+#pragma omp requires	/* { dg-error "requires at least one clause" } */
+#pragma omp requires unified_shared_memory,unified_shared_memory	/* { dg-error "too many 'unified_shared_memory' clauses" } */
+#pragma omp requires unified_address	unified_address	/* { dg-error "too many 'unified_address' clauses" } */
+#pragma omp requires reverse_offload reverse_offload	/* { dg-error "too many 'reverse_offload' clauses" } */
+#pragma omp requires foobarbaz	/* { dg-error "expected 'unified_address', 'unified_shared_memory', 'dynamic_allocators', 'reverse_offload' or 'atomic_default_mem_order' clause" } */
+
+int i;
+
+void
+foo ()
+{
+  #pragma omp requires dynamic_allocators , dynamic_allocators	/* { dg-error "too many 'dynamic_allocators' clauses" } */
+  if (0)
+    #pragma omp requires atomic_default_mem_order(seq_cst) atomic_default_mem_order(seq_cst)	/* { dg-error "too many 'atomic_default_mem_order' clauses" } */
+    i++;
+}
+
+#pragma omp requires atomic_default_mem_order (seq_cst)	/* { dg-error "more than one 'atomic_default_mem_order' clause in a single compilation unit" } */
--- gcc/testsuite/c-c++-common/gomp/requires-3.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/requires-3.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,3 @@ 
+#pragma omp requires atomic_default_mem_order(acquire)	/* { dg-error "expected 'seq_cst', 'relaxed' or 'acq_rel'" } */
+#pragma omp requires atomic_default_mem_order(release)	/* { dg-error "expected 'seq_cst', 'relaxed' or 'acq_rel'" } */
+#pragma omp requires atomic_default_mem_order(foobar)	/* { dg-error "expected 'seq_cst', 'relaxed' or 'acq_rel'" } */
--- gcc/testsuite/c-c++-common/gomp/requires-4.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/requires-4.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,11 @@ 
+#pragma omp requires unified_shared_memory,unified_address,reverse_offload
+void
+foo (void)
+{
+  #pragma omp target
+  ;
+  #pragma omp requires unified_shared_memory	/* { dg-error "'unified_shared_memory' clause used lexically after first target construct or offloading API" } */
+}
+
+#pragma omp requires unified_address	/* { dg-error "'unified_address' clause used lexically after first target construct or offloading API" } */
+#pragma omp requires reverse_offload	/* { dg-error "'reverse_offload' clause used lexically after first target construct or offloading API" } */
--- gcc/testsuite/c-c++-common/gomp/schedule-modifiers-1.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/c-c++-common/gomp/schedule-modifiers-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -68,18 +68,26 @@  void
 bar (void)
 {
   int i;
-  #pragma omp for schedule (nonmonotonic: static, 2)	/* { dg-error ".nonmonotonic. modifier specified for .static. schedule kind" } */
+  #pragma omp for schedule (nonmonotonic: static, 2)
   for (i = 0; i < 64; i++)
     ;
-  #pragma omp for schedule (nonmonotonic : static)	/* { dg-error ".nonmonotonic. modifier specified for .static. schedule kind" } */
+  #pragma omp for schedule (nonmonotonic : static)
   for (i = 0; i < 64; i++)
     ;
-  #pragma omp for schedule (nonmonotonic : runtime)	/* { dg-error ".nonmonotonic. modifier specified for .runtime. schedule kind" } */
+  #pragma omp for schedule (nonmonotonic : runtime)
   for (i = 0; i < 64; i++)
     ;
-  #pragma omp for schedule (nonmonotonic : auto)	/* { dg-error ".nonmonotonic. modifier specified for .auto. schedule kind" } */
+  #pragma omp for schedule (nonmonotonic : auto)
   for (i = 0; i < 64; i++)
     ;
+  #pragma omp for schedule (nonmonotonic : static) ordered	/* { dg-error ".nonmonotonic. schedule modifier specified together with .ordered. clause" } */
+  for (i = 0; i < 64; i++)
+    #pragma omp ordered
+      ;
+  #pragma omp for ordered schedule (nonmonotonic: static, 4)	/* { dg-error ".nonmonotonic. schedule modifier specified together with .ordered. clause" } */
+  for (i = 0; i < 64; i++)
+    #pragma omp ordered
+      ;
   #pragma omp for schedule (nonmonotonic : dynamic) ordered	/* { dg-error ".nonmonotonic. schedule modifier specified together with .ordered. clause" } */
   for (i = 0; i < 64; i++)
     #pragma omp ordered
@@ -98,6 +106,12 @@  bar (void)
   for (i = 0; i < 64; i++)
     {
       #pragma omp ordered depend(source)
+      #pragma omp ordered depend(sink: i - 1)
+    }
+  #pragma omp for schedule(nonmonotonic : runtime) ordered(1)	/* { dg-error ".nonmonotonic. schedule modifier specified together with .ordered. clause" } */
+  for (i = 0; i < 64; i++)
+    {
+      #pragma omp ordered depend(source)
       #pragma omp ordered depend(sink: i - 1)
     }
   #pragma omp for schedule (nonmonotonic , monotonic : dynamic)	/* { dg-error "both .monotonic. and .nonmonotonic. modifiers specified" } */
--- gcc/testsuite/c-c++-common/gomp/simd7.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/simd7.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,21 @@ 
+int a[64];
+
+#pragma omp declare simd linear(x)
+int
+bar (int x, int y)
+{
+  int v;
+  #pragma omp atomic capture
+  v = a[x] += y;
+  return v;
+}
+
+void
+foo (void)
+{
+  int i;
+  #pragma omp simd
+  for (i = 0; i < 64; i++)
+    #pragma omp atomic
+    a[i] += 1;
+}
--- gcc/testsuite/c-c++-common/gomp/target-data-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/target-data-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+  int a[4] = { 1, 2, 3, 4 };
+  #pragma omp target data map(to:a)
+  #pragma omp target data use_device_ptr(a)
+  #pragma omp target is_device_ptr(a)
+  {
+    a[0]++;
+  }
+  #pragma omp target data		/* { dg-error "must contain at least one" } */
+  a[0]++;
+  #pragma omp target data map(to:a)
+  #pragma omp target data use_device_ptr(a) use_device_ptr(a) /* { dg-error "appears more than once in data clauses" } */
+  a[0]++;
+}
--- gcc/testsuite/c-c++-common/gomp/taskloop-reduction-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/taskloop-reduction-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,10 @@ 
+int
+foo (int *a)
+{
+  int x = 0;
+  #pragma omp taskloop reduction (+:x) nogroup	/* { dg-error "'nogroup' clause must not be used together with 'reduction' clause" } */
+  for (int i = 0; i < 64; i++)
+    x += a[i];
+  #pragma omp taskwait
+  return x;
+}
--- gcc/testsuite/c-c++-common/gomp/taskwait-depend-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/taskwait-depend-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,11 @@ 
+void
+foo (int *p)
+{
+  #pragma omp taskwait depend(iterator(i = 0:16) , in : p[i]) depend(out : p[32])
+}
+
+void
+bar (int *p)
+{
+  #pragma omp taskwait depend(mutexinoutset : p[0])	/* { dg-error "'mutexinoutset' kind in 'depend' clause on a 'taskwait' construct" } */
+}
--- gcc/testsuite/c-c++-common/gomp/teams-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/teams-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,64 @@ 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int omp_get_num_teams (void);
+int omp_get_team_num (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+void bar (int *, int *, int *, int, int, int, int);
+
+void
+foo (void)
+{
+  int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6;
+  #pragma omp teams num_teams (4) shared (b) firstprivate (c, d) private (e, f)
+  {
+    f = 7;
+    bar (&a, &c, &e, b, d, f, 0);
+  }
+  bar (&a, (int *) 0, (int *) 0, b, 0, 0, 1);
+}
+
+void
+baz (void)
+{
+  #pragma omp teams
+  {
+    #pragma omp distribute
+    for (int i = 0; i < 64; i++)
+      ;
+    #pragma omp distribute simd
+    for (int i = 0; i < 64; i++)
+      ;
+    #pragma omp distribute parallel for
+    for (int i = 0; i < 64; i++)
+      ;
+    #pragma omp distribute parallel for
+    for (int i = 0; i < 64; i++)
+      ;
+    #pragma omp distribute parallel for simd
+    for (int i = 0; i < 64; i++)
+      ;
+    #pragma omp parallel
+    ;
+    #pragma omp parallel for
+    for (int i = 0; i < 64; i++)
+      ;
+    #pragma omp parallel for simd
+    for (int i = 0; i < 64; i++)
+      ;
+    int a, b;
+    #pragma omp parallel sections
+    {
+      a = 5;
+      #pragma omp section
+      b = 6;
+    }
+    int c = omp_get_num_teams ();
+    int d = omp_get_team_num ();
+  }
+}
--- gcc/testsuite/c-c++-common/gomp/teams-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/c-c++-common/gomp/teams-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,119 @@ 
+void
+foo (void)
+{
+  int i;
+
+  #pragma omp parallel
+  {
+    #pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+    ;
+  }
+  #pragma omp teams
+  {
+    #pragma omp teams	/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    ;
+  }
+  #pragma omp target
+  {
+    #pragma omp parallel
+    {
+      #pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+      ;
+    }
+  }
+  #pragma omp for
+  for (i = 0; i < 4; i++)
+    if (i == 0)
+      {
+	#pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+	;
+      }
+  #pragma omp single
+  #pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+  ;
+  #pragma omp master
+  {
+    #pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+    ;
+  }
+  #pragma omp critical
+  #pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+  ;
+  #pragma omp sections
+  {
+    #pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+    ;
+    #pragma omp section
+    {
+      #pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+      ;
+    }
+  }
+  #pragma omp target data map (to: i)
+  {
+    #pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+    ;
+  }
+  #pragma omp task
+  {
+    #pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+    ;
+  }
+  #pragma omp taskgroup
+  {
+    #pragma omp teams	/* { dg-error "'teams' construct must be closely nested inside of 'target' construct or not nested in any OpenMP construct" } */
+    ;
+  }
+}
+
+void
+bar (void)
+{
+  #pragma omp teams
+  {
+    int x, y, v = 4;
+    #pragma omp target			/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    ;
+    #pragma omp target data map (to: v)	/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    ;
+    #pragma omp for			/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    for (int i = 0; i < 64; ++i)
+      ;
+    #pragma omp simd			/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    for (int i = 0; i < 64; ++i)
+      ;
+    #pragma omp for simd		/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    for (int i = 0; i < 64; ++i)
+      ;
+    #pragma omp single			/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    ;
+    #pragma omp master			/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    ;
+    #pragma omp sections		/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    {
+      x = 1;
+      #pragma omp section
+      y = 2;
+    }
+    #pragma omp critical		/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    ;
+    #pragma omp target enter data map (to: v)	/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    #pragma omp target exit data map (from: v)	/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    #pragma omp cancel parallel		/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    #pragma omp cancellation point parallel /* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    #pragma omp barrier			/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    #pragma omp ordered			/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    ;
+    #pragma omp task			/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    ;
+    #pragma omp taskloop		/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    for (int i = 0; i < 64; ++i)
+      ;
+    #pragma omp atomic			/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    v++;
+    #pragma omp taskgroup		/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    ;
+    #pragma omp taskwait		/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+    #pragma omp taskyield		/* { dg-error "only 'distribute' or 'parallel' regions are allowed to be strictly nested inside 'teams' region" } */
+  }
+}
--- gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -10,14 +10,15 @@  a24 (int a)
   const int c = 1;
   int i = 0;
   int l = 0;
-#pragma omp parallel default(none) private(a) shared(z) /* { dg-line omp_parallel } */
+#pragma omp parallel default(none) private(a) shared(z, c) /* { dg-line omp_parallel } */
   {
     int j = omp_get_num_threads ();
-    /* O.K. - j is declared within parallel region */
-    /* O.K.  -  a is listed in private clause */
-    /*       -  z is listed in shared clause */
+	/* O.K. - j is declared within parallel region */
+    a = z[j]; /* O.K.  -  a is listed in private clause */
+	      /*       -  z is listed in shared clause */
     x = c;			/* O.K.  -  x is threadprivate */
-    				/*       -  c has const-qualified type */
+    				/*       -  c has const-qualified type and
+					      is listed in shared clause */
     z[i] = y;
     /* { dg-error "'i' not specified" "" { target *-*-* } .-1 } */
     /* { dg-error "enclosing 'parallel'" "" { target *-*-* } omp_parallel } */
--- gcc/testsuite/gcc.dg/gomp/atomic-5.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/gcc.dg/gomp/atomic-5.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -27,7 +27,7 @@  void f1(void)
   #pragma omp atomic
     bar() += 1;		/* { dg-error "lvalue required" } */
   #pragma omp atomic a	/* { dg-error "expected end of line" } */
-    x++;
+    x++;		/* { dg-error "expected 'read', 'write', 'update', 'capture', 'seq_cst', 'acq_rel', 'release', 'relaxed' or 'hint' clause" "" { target *-*-* } .-1 } */
   #pragma omp atomic
     ;			/* { dg-error "expected expression" } */
   #pragma omp atomic
--- gcc/testsuite/gcc.dg/gomp/clause-1.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/gcc.dg/gomp/clause-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -86,18 +86,18 @@  foo (int x)
 #pragma omp p for linear (t) /* { dg-error "predetermined 'threadprivate" } */
   for (i = 0; i < 10; i++)
     ;
-#pragma omp p shared (c) /* { dg-error "predetermined 'shared'" } */
+#pragma omp p shared (c)
     ;
-#pragma omp p private (c) /* { dg-error "predetermined 'shared'" } */
+#pragma omp p private (c) /* { dg-error "'const' qualified 'c' may appear only in 'shared' or 'firstprivate' clauses" } */
     ;
 #pragma omp p firstprivate (c)
     ;
-#pragma omp p for lastprivate (c) /* { dg-error "predetermined 'shared'" } */
+#pragma omp p for lastprivate (c) /* { dg-error "'const' qualified 'c' may appear only in 'shared' or 'firstprivate' clauses" } */
   for (i = 0; i < 10; i++)
     ;
-#pragma omp p reduction (*:c) /* { dg-error "predetermined 'shared'" } */
+#pragma omp p reduction (*:c) /* { dg-error "'const' qualified 'c' may appear only in 'shared' or 'firstprivate' clauses" } */
     ;
-#pragma omp p for linear (c) /* { dg-error "predetermined 'shared'" } */
+#pragma omp p for linear (c) /* { dg-error "'const' qualified 'c' may appear only in 'shared' or 'firstprivate' clauses" } */
   for (i = 0; i < 10; i++)
     ;
 }
--- gcc/testsuite/gcc.dg/gomp/combined-1.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/gcc.dg/gomp/combined-1.c	(.../branches/gomp-5_0-branch)	(nonexistent)
@@ -1,23 +0,0 @@ 
-/* { dg-do compile } */
-/* { dg-options "-O1 -fopenmp -fdump-tree-optimized" } */
-
-int a[10];
-int foo (void)
-{
-    int i;
-#pragma omp parallel for schedule(runtime)
-    for (i = 0; i < 10; i++)
-      a[i] = i;
-#pragma omp parallel
-#pragma omp for schedule(runtime)
-    for (i = 0; i < 10; i++)
-      a[i] = 10 - i;
-#pragma omp parallel
-      {
-#pragma omp for schedule(runtime)
-	for (i = 0; i < 10; i++)
-	  a[i] = i;
-      }
-}
-
-/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop_runtime" 3 "optimized" } } */
--- gcc/testsuite/gcc.dg/gomp/for-4.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/gcc.dg/gomp/for-4.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -12,5 +12,5 @@  void foo (int n)
     bar(i);
 }
 
-/* { dg-final { scan-tree-dump-times "GOMP_loop_dynamic_start" 1 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_loop_dynamic_next" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_nonmonotonic_dynamic_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_nonmonotonic_dynamic_next" 1 "ompexp" } } */
--- gcc/testsuite/gcc.dg/gomp/for-5.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/gcc.dg/gomp/for-5.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -12,5 +12,5 @@  void foo (int n)
     bar(i);
 }
 
-/* { dg-final { scan-tree-dump-times "GOMP_loop_guided_start" 1 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_loop_guided_next" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_nonmonotonic_guided_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_nonmonotonic_guided_next" 1 "ompexp" } } */
--- gcc/testsuite/gcc.dg/gomp/for-6.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/gcc.dg/gomp/for-6.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -12,5 +12,5 @@  void foo (int n)
     bar(i);
 }
 
-/* { dg-final { scan-tree-dump-times "GOMP_loop_runtime_start" 1 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_loop_runtime_next" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_maybe_nonmonotonic_runtime_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_maybe_nonmonotonic_runtime_next" 1 "ompexp" } } */
--- gcc/testsuite/gcc.dg/gomp/pr39495-2.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/gcc.dg/gomp/pr39495-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -13,25 +13,25 @@  foo (void)
   unsigned int u;
 
 #pragma omp for
-  for (i = INT_MIN + 6; i != INT_MIN; i--)	/* { dg-error "invalid controlling predicate" } */
+  for (i = INT_MIN + 6; i != INT_MIN; i--)
     ;
 #pragma omp for
   for (i = INT_MIN + 6; i == INT_MIN; i--)	/* { dg-error "invalid controlling predicate" } */
     ;
 #pragma omp for
-  for (i = INT_MAX - 6; i != INT_MAX; i++)	/* { dg-error "invalid controlling predicate" } */
+  for (i = INT_MAX - 6; i != INT_MAX; i++)
     ;
 #pragma omp for
   for (i = INT_MAX - 6; i == INT_MAX; i++)	/* { dg-error "invalid controlling predicate" } */
     ;
 #pragma omp for
-  for (u = 6; u != 0; u--)			/* { dg-error "invalid controlling predicate" } */
+  for (u = 6; u != 0; u--)
     ;
 #pragma omp for
   for (u = 6; u == 0; u--)			/* { dg-error "invalid controlling predicate" } */
     ;
 #pragma omp for
-  for (u = UINT_MAX - 6; u != UINT_MAX; u++)	/* { dg-error "invalid controlling predicate" } */
+  for (u = UINT_MAX - 6; u != UINT_MAX; u++)
     ;
 #pragma omp for
   for (u = UINT_MAX - 6; u == UINT_MAX; u++)	/* { dg-error "invalid controlling predicate" } */
--- gcc/testsuite/gcc.dg/gomp/reduction-2.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/gcc.dg/gomp/reduction-2.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,30 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+struct S {};
+void foo (void *, void *);
+void bar (void *, void *);
+void baz (void *);
+#pragma omp declare reduction(+:struct S:foo (&omp_out, &omp_in))initializer(bar(&omp_priv, &omp_orig))
+
+void
+test1 (void)
+{
+  struct S s;
+  int i;
+  #pragma omp parallel reduction(+:s)
+    baz (&s);
+  #pragma omp parallel reduction(task, +:s)	/* { dg-error "zero sized type 'struct S' in 'reduction' clause" } */
+    baz (&s);
+  #pragma omp taskloop reduction(+:s)		/* { dg-error "zero sized type 'struct S' in 'reduction' clause" } */
+  for (i = 0; i < 1; i++)
+    baz (&s);
+  #pragma omp taskloop simd reduction(+:s)	/* { dg-error "zero sized type 'struct S' in 'reduction' clause" } */
+  for (i = 0; i < 1; i++)
+    baz (&s);
+  #pragma omp taskgroup task_reduction(+:s)	/* { dg-error "zero sized type 'struct S' in 'task_reduction' clause" } */
+  {
+    #pragma omp task in_reduction(+:s)		/* { dg-error "zero sized type 'struct S' in 'in_reduction' clause" } */
+    baz (&s);
+  }
+}
--- gcc/testsuite/gcc.dg/gomp/sharing-1.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/gcc.dg/gomp/sharing-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -44,7 +44,7 @@  main (void)
       thrglobalvar++;	/* Predetermined - threadprivate.  */
       thrlocvar++;	/* Predetermined - threadprivate.  */
       foo (i);		/* Predetermined - private (omp for loop variable).  */
-      foo (constvar);	/* Predetermined - shared (const qualified type).  */
+      foo (constvar);	/* { dg-error "not specified in" } */
       foo (*p);		/* *p predetermined - shared (heap allocated */
       (*p)++;		/* storage).  */
       bar (p);		/* Explicitly determined - private.  */
--- gcc/testsuite/gcc.dg/gomp/simd-1.c	(.../trunk)	(nonexistent)
+++ gcc/testsuite/gcc.dg/gomp/simd-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,21 @@ 
+int a[32], b[32];
+
+void
+foo (void)
+{
+  int i, j;
+  #pragma omp simd linear(i, j) collapse(2)	/* { dg-error "iteration variable 'i' should not be linear" } */
+  for (i = 0; i < 32; ++i)			/* { dg-error "iteration variable 'j' should not be linear" "" { target *-*-* } .-1 } */
+    for (j = 0; j < 32; ++j)
+      a[i] += b[j];
+}
+
+void
+bar (void)
+{
+  static int i, j;
+  #pragma omp for simd linear(i, j) collapse(2)	/* { dg-error "iteration variable 'i' should not be linear" } */
+  for (i = 0; i < 32; ++i)			/* { dg-error "iteration variable 'j' should not be linear" "" { target *-*-* } .-1 } */
+    for (j = 0; j < 32; ++j)
+      a[i] += b[j];
+}
--- gcc/testsuite/gcc.dg/gomp/teams-1.c	(.../trunk)	(revision 265884)
+++ gcc/testsuite/gcc.dg/gomp/teams-1.c	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -23,8 +23,8 @@  foo (int x)
 
   switch (x) // { dg-error "invalid entry to OpenMP structured block" }
   {
-  #pragma omp target teams
-    { case 0:; } // { dg-warning "statement will never be executed" }
+  #pragma omp target teams // { dg-warning "statement will never be executed" }
+    { case 0:; }
   }
 }
 
--- gcc/testsuite/g++.dg/gomp/atomic-18.C	(.../trunk)	(nonexistent)
+++ gcc/testsuite/g++.dg/gomp/atomic-18.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,50 @@ 
+// { dg-do compile }
+// { dg-additional-options "-fdump-tree-original" }
+// { dg-final { scan-tree-dump-times "omp atomic release" 5 "original" } }
+// { dg-final { scan-tree-dump-times "omp atomic seq_cst" 1 "original" } }
+// { dg-final { scan-tree-dump-times "omp atomic relaxed" 2 "original" } }
+// { dg-final { scan-tree-dump-times "omp atomic capture acq_rel" 3 "original" } }
+// { dg-final { scan-tree-dump-times "omp atomic capture acquire" 1 "original" } }
+// { dg-final { scan-tree-dump-times "omp atomic read acquire" 1 "original" } }
+
+int i, v;
+float f;
+
+template <int N, int M, typename T>
+void
+foo (T *p)
+{
+  #pragma omp atomic release, hint (N), update
+  i = i + 1;
+  #pragma omp atomic hint(0)seq_cst
+  i = i + 1;
+  #pragma omp atomic relaxed,update,hint (N)
+  i = i + 1;
+  #pragma omp atomic release
+  i = i + 1;
+  #pragma omp atomic relaxed
+  i = i + 1;
+  #pragma omp atomic acq_rel capture
+  v = i = i + 1;
+  #pragma omp atomic capture,acq_rel , hint (M)
+  v = i = i + 1;
+  #pragma omp atomic hint(N),acquire capture
+  v = i = i + 1;
+  #pragma omp atomic read acquire
+  v = i;
+  #pragma omp atomic release,write
+  i = v;
+  #pragma omp atomic hint(1),update,release
+  f = f + 2.0;
+  #pragma omp requires atomic_default_mem_order (acq_rel)
+  #pragma omp atomic hint (M - 1) update
+  *p += 1;
+  #pragma omp atomic capture, hint (M)
+  v = *p = *p + 1;
+}
+
+void
+bar ()
+{
+  foo <0, 1, int> (&i);
+}
--- gcc/testsuite/g++.dg/gomp/atomic-19.C	(.../trunk)	(nonexistent)
+++ gcc/testsuite/g++.dg/gomp/atomic-19.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,17 @@ 
+int i;
+
+template <int N, typename T>
+void
+foo (T x)
+{
+  #pragma omp atomic hint (x)		// { dg-error "must be integral" }
+  i = i + 1;
+  #pragma omp atomic hint (N + i)	// { dg-error "constant integer expression" }
+  i = i + 1;
+}
+
+void
+bar ()
+{
+  foo <0, float> (1.0f);
+}
--- gcc/testsuite/g++.dg/gomp/atomic-5.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/atomic-5.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -12,18 +12,18 @@  void f1(void)
     x = x + 1;
   #pragma omp atomic
     x = 1;		/* { dg-error "invalid form" } */
-  #pragma omp atomic
+  #pragma omp atomic	/* { dg-error "read-only variable" } */
     ++y;		/* { dg-error "read-only variable" } */
-  #pragma omp atomic
+  #pragma omp atomic	/* { dg-error "read-only variable" } */
     y--;		/* { dg-error "read-only variable" } */
-  #pragma omp atomic
-    y += 1;		/* { dg-error "read-only variable" } */
+  #pragma omp atomic	/* { dg-error "read-only variable" } */
+    y += 1;
   #pragma omp atomic
     bar();		/* { dg-error "invalid operator" } */
   #pragma omp atomic
     bar() += 1;		/* { dg-error "lvalue required" } */
   #pragma omp atomic a	/* { dg-error "expected end of line" } */
-    x++;
+    x++;		/* { dg-error "expected 'read', 'write', 'update', 'capture', 'seq_cst', 'acq_rel', 'release', 'relaxed' or 'hint' clause" "" { target *-*-* } .-1 } */
   #pragma omp atomic
     ;			/* { dg-error "expected primary-expression" } */
   #pragma omp atomic
--- gcc/testsuite/g++.dg/gomp/clause-3.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/clause-3.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -86,18 +86,18 @@  foo (int x)
 #pragma omp p for linear (t) // { dg-error "predetermined 'threadprivate'" }
   for (i = 0; i < 10; i++)
     ;
-#pragma omp p shared (c) // { dg-error "predetermined 'shared'" }
+#pragma omp p shared (c)
     ;
-#pragma omp p private (c) // { dg-error "predetermined 'shared'" }
+#pragma omp p private (c) // { dg-error "may appear only in 'shared' or 'firstprivate' clauses" }
     ;
 #pragma omp p firstprivate (c)
     ;
-#pragma omp p for lastprivate (c) // { dg-error "predetermined 'shared'" }
+#pragma omp p for lastprivate (c) // { dg-error "may appear only in 'shared' or 'firstprivate' clauses" }
   for (i = 0; i < 10; i++)
     ;
-#pragma omp p reduction (*:c) // { dg-error "predetermined 'shared'" }
+#pragma omp p reduction (*:c) // { dg-error "may appear only in 'shared' or 'firstprivate' clauses" }
     ;
-#pragma omp p for linear (c:2) // { dg-error "predetermined 'shared'" }
+#pragma omp p for linear (c:2) // { dg-error "may appear only in 'shared' or 'firstprivate' clauses" }
   for (i = 0; i < 10; i++)
     ;
 }
--- gcc/testsuite/g++.dg/gomp/critical-3.C	(.../trunk)	(nonexistent)
+++ gcc/testsuite/g++.dg/gomp/critical-3.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,33 @@ 
+int i;
+
+template <int N>
+void
+foo (void)
+{
+  #pragma omp critical (foo), hint (N + 1)
+  i++;
+}
+
+template <int N>
+void
+bar (void)
+{
+  #pragma omp critical (bar), hint (N + i)	// { dg-error "constant integer expression" }
+  i++;
+}
+
+template <typename T>
+void
+baz (T x)
+{
+  #pragma omp critical (baz) hint (x)	// { dg-error "expression must be integral" }
+  i++;
+}
+
+void
+test ()
+{
+  foo <0> ();
+  bar <0> ();
+  baz (0.0);
+}
--- gcc/testsuite/g++.dg/gomp/depend-iterator-1.C	(.../trunk)	(nonexistent)
+++ gcc/testsuite/g++.dg/gomp/depend-iterator-1.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,86 @@ 
+int arr[64], arr2[64];
+struct S { int a[4]; } k;
+short arr4[4];
+volatile int v;
+#define TEST_EQ(x,y) ({ int o[x == y ? 1 : -1]; 0; })
+
+template <typename T, typename U, typename V, typename W, int N>
+void
+foo (unsigned char i, signed char j)
+{
+  #pragma omp task depend (iterator (T j=6:N:-2) , out : \
+	arr[TEST_EQ (sizeof (j), sizeof (int)), \
+	    TEST_EQ (sizeof (i), sizeof (unsigned char)), \
+	    TEST_EQ (sizeof (k), sizeof (struct S)), j], \
+	arr2[TEST_EQ (((__typeof (j)) -1) < 0, 1), \
+	     TEST_EQ (((__typeof (i)) -1) < 0, 0), \
+	     TEST_EQ (((__typeof (k.a[0])) -1) < 0, 1), j]) \
+	depend(out: arr[0]) \
+	depend (iterator (U i=__LONG_LONG_MAX__ - 4:__LONG_LONG_MAX__ - N:N, \
+			  V j=~0U-16:~0U-8:3, \
+			  W *k=&arr4[1]:&arr4[2]:1) , in : \
+	arr[TEST_EQ (sizeof (i), sizeof (long long)), \
+	    TEST_EQ (sizeof (j), sizeof (unsigned short)), \
+	    TEST_EQ (sizeof (k), sizeof (short *)), \
+	    TEST_EQ (sizeof (*k), sizeof (short)), i - __LONG_LONG_MAX__ + 4], \
+	arr2[TEST_EQ (((__typeof (i)) -1) < 0, 1), \
+	     TEST_EQ (((__typeof (j)) -1) < 0, 0), \
+	     TEST_EQ (((__typeof (*k)) -1) < 0, 1), j - (~0U-16)], \
+	arr2[k - &arr4[0]]) \
+	depend(in : k)
+    v++;
+}
+
+template <typename U, typename W, int N>
+void
+bar (unsigned char i, signed char j)
+{
+  int m = j;
+  int n = j + 2;
+  #pragma omp task depend (iterator (j=N:2:m) , out : \
+	arr[TEST_EQ (sizeof (j), sizeof (int)), \
+	    TEST_EQ (sizeof (i), sizeof (unsigned char)), \
+	    TEST_EQ (sizeof (k), sizeof (struct S)), j], \
+	arr2[TEST_EQ (((__typeof (j)) -1) < 0, 1), \
+	     TEST_EQ (((__typeof (i)) -1) < 0, 0), \
+	     TEST_EQ (((__typeof (k.a[0])) -1) < 0, 1), j]) \
+	depend(out: arr[0]) \
+	depend (iterator (U i=__LONG_LONG_MAX__ - 4 - n:__LONG_LONG_MAX__ - 2:2, \
+			  unsigned short j=~0U-16:~0U-8-n:3, \
+			  W k=&arr4[N-5]:&arr4[n + 2]:1) , in : \
+	arr[TEST_EQ (sizeof (i), sizeof (long long)), \
+	    TEST_EQ (sizeof (j), sizeof (unsigned short)), \
+	    TEST_EQ (sizeof (k), sizeof (short *)), \
+	    TEST_EQ (sizeof (*k), sizeof (short)), i - __LONG_LONG_MAX__ + 4], \
+	arr2[TEST_EQ (((__typeof (i)) -1) < 0, 1), \
+	     TEST_EQ (((__typeof (j)) -1) < 0, 0), \
+	     TEST_EQ (((__typeof (*k)) -1) < 0, 1), j - (~0U-16)], \
+	arr2[k - &arr4[0]:10]) \
+	depend(in : k)
+    v++;
+}
+
+template <typename T, typename U, int N>
+void
+baz (void)
+{
+  #pragma omp parallel
+  #pragma omp master
+  {
+    #pragma omp task depend(iterator(T k = N : 2) , inout : \
+	arr[TEST_EQ (sizeof (k), sizeof (unsigned long)), \
+	    TEST_EQ (((__typeof (k)) -1) < N, 0), k]) \
+	depend(iterator(U s = -3 : -12 : -1 + N) , out : \
+	arr[TEST_EQ (sizeof (s), sizeof (signed char)), \
+	    TEST_EQ (((__typeof (s)) -1) < 0, 1), s + 12])
+      v++;
+  }
+}
+
+void
+test (void)
+{
+  foo <int, long long, unsigned short, short, 2> (0, 0);
+  bar <long long, short *, 6> (0, -2);
+  baz <unsigned long int, signed char, 0> ();
+}
--- gcc/testsuite/g++.dg/gomp/depend-iterator-2.C	(.../trunk)	(nonexistent)
+++ gcc/testsuite/g++.dg/gomp/depend-iterator-2.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,121 @@ 
+int a, b[64];
+struct S { int c; } *d, *e;
+struct T;
+struct T *f, *g;
+int *h;
+
+template <typename U, typename V, typename W, W N>
+void
+f1 ()
+{
+  #pragma omp task depend (iterator , in : a)	// { dg-error "expected" }
+  ;
+  #pragma omp task depend (iterator (for = 0 : 2) , in : a)	// { dg-error "expected" }
+  ;
+  #pragma omp task depend (iterator (5 = 0 : 2) , in : a)	// { dg-error "expected" }
+  ;
+  #pragma omp task depend (iterator (i : N : 2) , in : a)	// { dg-error "expected '='|name a type|expected" }
+  ;
+  #pragma omp task depend (iterator (i = 0, 1 : 2) , in : a)	// { dg-error "expected" }
+  ;
+  #pragma omp task depend (iterator (i = (0, 1) : 2) , in : a)
+  ;
+  #pragma omp task depend (iterator (i = 0 : 1 : 2 : 3) , in : a)	// { dg-error "expected '.'" }
+  ;
+  #pragma omp task depend (iterator (i = 0 : 2, 3) , in : a)	// { dg-error "expected" }
+  ;
+  #pragma omp task depend (iterator (i = N : 10 : 2, 3) , in : a)	// { dg-error "expected" }
+  ;
+  #pragma omp task depend (iterator (i = 0:1), iterator (j = 0:1) , in : a)	// { dg-error "invalid depend kind" }
+  ;
+  #pragma omp task depend (iterator (i = N:32) , in : b[i*2:2])
+  ;
+  #pragma omp task depend (iterator (void i = 0:1) , in : a)		// { dg-error "iterator 'i' has neither integral nor pointer type" }
+  ;
+  #pragma omp task depend (iterator (U *p = d:e:2) , in : a)
+  ;
+  #pragma omp task depend (iterator (W i = N:4, \
+				     struct U2 { W *p; } *p = 0:2) , in : a) // { dg-error "types may not be defined in iterator type" }
+  ;
+  #pragma omp task depend (iterator (i = 0:4, j = i:16) , in : a)	// { dg-error "begin expression refers to outer iterator 'i'" }
+  ;
+  #pragma omp task depend (iterator (i = N:4, j = 2:i:1) , in : a)	// { dg-error "end expression refers to outer iterator 'i'" }
+  ;
+  #pragma omp task depend (iterator (i = 0:4, j = 2:8:i) , in : a)	// { dg-error "step expression refers to outer iterator 'i'" }
+  ;
+  #pragma omp task depend (iterator (i = 1.25:2.5:3) , in : a)
+  ;
+  #pragma omp task depend (iterator (i = 1:2:3.5) , in : a)		// { dg-error "iterator step with non-integral type" }
+  ;
+  #pragma omp task depend (iterator (W *p = 23 : h) , in : a)
+  ;
+  #pragma omp task depend (iterator (const int i = N : 2) , in : a)	// { dg-error "const qualified" }
+  ;
+  #pragma omp task depend (iterator (const long long unsigned i = 0 : 2) , in : a)	// { dg-error "const qualified" }
+  ;
+}
+
+template <typename W, int N>
+void
+f2 ()
+{
+  int i, j;
+  #pragma omp for ordered(2)
+  for (i = 0; i < 64; i++)
+    for (j = 0; j < 64; j++)
+      {
+      #pragma omp ordered depend (iterator (k=0:N) , sink: i - 1, j - 1)	// { dg-error "'iterator' modifier incompatible with 'sink'" }
+      #pragma omp ordered depend (iterator (W l = 0:2:3) , source)		// { dg-error "'iterator' modifier incompatible with 'source'" }
+      }
+}
+
+template <typename U, typename V, typename W, W N, typename X, typename Y>
+void
+f3 ()
+{
+  #pragma omp task depend (iterator (U i = 0:1), in : a)		// { dg-error "iterator 'i' has neither integral nor pointer type" }
+  ;
+  #pragma omp task depend (iterator (V f = 0.2:0.4) , in : a)	// { dg-error "iterator 'f' has neither integral nor pointer type" }
+  ;
+  #pragma omp task depend (iterator (struct T *p = f:g) , in : a)	// { dg-error "invalid use of" }
+  ;
+  #pragma omp task depend (iterator (i = *d:2) , in : a)	// { dg-error "invalid cast from type 'S' to type 'int'" }
+  ;
+  #pragma omp task depend (iterator (i = 2:*d:2) , in : a)	// { dg-error "invalid cast from type 'S' to type 'int'" }
+  ;
+  #pragma omp task depend (iterator (i = 2:4:*d) , in : a)	// { dg-error "iterator step with non-integral type" }
+  ;
+  #pragma omp task depend (iterator (i = 1.25:2.5:3) , in : a)
+  ;
+  #pragma omp task depend (iterator (i = 1:2:3.5) , in : a)	// { dg-error "iterator step with non-integral type" }
+  ;
+  #pragma omp task depend (iterator (W *p = 23 : h) , in : a)
+  ;
+  #pragma omp task depend (iterator (short i=1:3:N) , in : a)	// { dg-error "iterator 'i' has zero step" }
+  ;
+  #pragma omp task depend (iterator (i = 1 : 3 : N + 3 - 3) , in : a)	// { dg-error "iterator 'i' has zero step" }
+  ;
+  #pragma omp task depend (iterator (int *p = &b[6]:&b[9]:4 - 4) , in : a)	// { dg-error "iterator 'p' has zero step" }
+  ;
+  #pragma omp task depend (iterator (X i = N : 2) , in : a)	// { dg-error "const qualified" }
+  ;
+  #pragma omp task depend (iterator (Y i = 0 : 2) , in : a)	// { dg-error "const qualified" }
+  ;
+}
+
+template <int N>
+void
+f4 ()
+{
+  #pragma omp task depend (iterator (i = 0:1), iterator (j = 0:1) , in : a)	// { dg-error "invalid depend kind" }
+  ;
+}
+
+void
+f5 ()
+{
+  f1 <struct S, float, int, 0> ();
+  f2 <int, 1> ();
+  f3 <struct S, float, int, 0, const int, const long long unsigned> ();
+  f4 <0> ();
+}
--- gcc/testsuite/g++.dg/gomp/depobj-1.C	(.../trunk)	(nonexistent)
+++ gcc/testsuite/g++.dg/gomp/depobj-1.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,118 @@ 
+typedef struct __attribute__((__aligned__ (sizeof (void *)))) omp_depend_t {
+  char __omp_depend_t__[2 * sizeof (void *)];
+} omp_depend_t;
+
+omp_depend_t bar (void);
+extern const omp_depend_t cdepobj;
+extern omp_depend_t depobj, depobj4;
+extern omp_depend_t depobja[4];
+extern omp_depend_t *pdepobj;
+int a, b, i, j;
+
+template <int N>
+void
+f1 (bool x)
+{
+  #pragma omp depobj(x ? depobj : depobj4) depend(in : x ? a : b)
+  #pragma omp depobj(x ? depobj : depobj4) update(inout)
+  #pragma omp task depend (depobj:depobj)
+  ;
+  #pragma omp depobj(depobj) destroy
+  #pragma omp task depend (iterator (i=1:3) , depobj: *(depobja + i))
+  ;
+  #pragma omp depobj(pdepobj[0]) depend(mutexinoutset:a)
+  #pragma omp depobj(*pdepobj) destroy
+}
+
+template <typename T, typename T2>
+void
+f2 (T &depobj2, T2 depobj3, T *pdepobj)
+{
+  T depobj1;
+  T depobja[4];
+  #pragma omp depobj(depobj1) depend(in : --a)
+  #pragma omp depobj(depobj1) update(inout)
+  #pragma omp task depend (depobj: depobj1)
+  ;
+  #pragma omp depobj(depobj1) destroy
+  #pragma omp depobj(depobj2) depend(in : a)
+  #pragma omp depobj(depobj2) update(inout)
+  #pragma omp task depend (depobj :depobj2)
+  ;
+  #pragma omp depobj(depobj2) destroy
+  #pragma omp depobj(depobj3) depend(in : a)
+  #pragma omp depobj(depobj3) update(inout)
+  #pragma omp task depend (depobj  :  depobj3)
+  ;
+  #pragma omp depobj(depobj3) destroy
+  for (int q = 1; q < 3; q++)
+    {
+      #pragma omp depobj(depobja[q]) depend (in:a)
+    }
+  #pragma omp task depend (iterator (i=1:3) , depobj : *(depobja + i))
+  ;
+  for (int q = 1; q < 3; q++)
+    {
+      #pragma omp depobj(depobja[q]) destroy
+    }
+  #pragma omp depobj(pdepobj[0]) depend(mutexinoutset:a)
+  #pragma omp depobj(*pdepobj) destroy
+}
+
+void
+f3 (bool x)
+{
+  omp_depend_t depobjx, depobjy;
+  f1 <0> (x);
+  f2 <omp_depend_t, omp_depend_t &> (depobjx, depobjy, pdepobj);
+}
+
+template <int N>
+void
+f4 (void)
+{
+  omp_depend_t depobjb[4];
+  #pragma omp depobj					// { dg-error "expected" }
+  #pragma omp depobj destroy				// { dg-error "expected" }
+  #pragma omp depobj (depobj)				// { dg-error "expected 'depend', 'destroy' or 'update' clause" }
+  #pragma omp depobj (depobj) foobar			// { dg-error "expected 'depend', 'destroy' or 'update' clause" }
+  #pragma omp depobj(bar ()) update(inout)		// { dg-error "'depobj' expression is not lvalue expression" }
+  #pragma omp depobj (cdepobj) update(in)		// { dg-error "'const' qualified 'depobj' expression" }
+  #pragma omp depobj (depobjb) depend(in: a)		// { dg-error "type of 'depobj' expression is not 'omp_depend_t'" }
+  #pragma omp depobj (pdepobj) depend(in: a)		// { dg-error "type of 'depobj' expression is not 'omp_depend_t'" }
+  #pragma omp depobj (a) destroy			// { dg-error "type of 'depobj' expression is not 'omp_depend_t'" }
+  #pragma omp depobj (depobj) depend(depobj:a)		// { dg-error "does not have 'omp_depend_t' type in 'depend' clause with 'depobj' dependence type" }
+  #pragma omp depobj (depobj) depend(depobj:*depobjb)	// { dg-error "'depobj' dependence type specified in 'depend' clause on 'depobj' construct" }
+  #pragma omp depobj (depobj) update(foobar)		// { dg-error "expected 'in', 'out', 'inout' or 'mutexinoutset'" }
+  #pragma omp depobj (depobj) depend(in: *depobja)	// { dg-error "should not have 'omp_depend_t' type in 'depend' clause with dependence type" }
+  #pragma omp depobj (depobj) depend(in: a) depend(in: b)	// { dg-error "expected" }
+  #pragma omp depobj (depobj) depend(in: a) update(out)	// { dg-error "expected" }
+  #pragma omp depobj (depobj) depend(in: a, b)		// { dg-error "more than one locator in 'depend' clause on 'depobj' construct" }
+  #pragma omp depobj (depobj) depend(source)		// { dg-error "'depend\\(source\\)' is only allowed in 'omp ordered'" }
+  #pragma omp depobj (depobj) depend(sink: i + 1, j - 1)	// { dg-error "'depend\\(sink\\)' is only allowed in 'omp ordered'" }
+  #pragma omp depobj (depobj) depend(iterator (i = 0:2) , in : a)	// { dg-error "'iterator' modifier may not be specified on 'depobj' construct" }
+  if (0)
+    #pragma omp depobj (depobj) destroy			// { dg-error "'#pragma omp depobj' may only be used in compound statements" }
+    ;
+}
+
+template <int N>
+void
+f5 (void)
+{
+  #pragma omp task depend (depobj:depobja[1:2])		// { dg-error "'depend' clause with 'depobj' dependence type on array section" }
+  ;
+  #pragma omp task depend (depobj : a)			// { dg-error "'a' does not have 'omp_depend_t' type in 'depend' clause with 'depobj' dependence type" }
+  ;
+  #pragma omp task depend (in: depobj)			// { dg-error "'depobj' should not have 'omp_depend_t' type in 'depend' clause with dependence type" }
+  ;
+}
+
+void
+f6 (omp_depend_t &x)
+{
+  f4 <0> ();
+  f5 <0> ();
+  #pragma omp depobj (x) depend(in: a)
+  #pragma omp depobj (depobj) depend(in: x)		// { dg-error "should not have 'omp_depend_t' type in 'depend' clause with dependence type" }
+}
--- gcc/testsuite/g++.dg/gomp/doacross-1.C	(.../trunk)	(nonexistent)
+++ gcc/testsuite/g++.dg/gomp/doacross-1.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,21 @@ 
+// { dg-do compile { target c++11 } }
+// { dg-options "-fopenmp" }
+
+int a[42];
+
+void
+foo ()
+{
+  #pragma omp for ordered (1)	// { dg-error "'ordered' clause with parameter on range-based 'for' loop" }
+  for (auto x : a)
+    ;
+}
+
+void
+bar ()
+{
+  #pragma omp for ordered (2)	// { dg-error "'ordered' clause with parameter on range-based 'for' loop" }
+  for (int i = 0; i < 1; i++)
+    for (auto x : a)
+      ;
+}
--- gcc/testsuite/g++.dg/gomp/for-21.C	(.../trunk)	(nonexistent)
+++ gcc/testsuite/g++.dg/gomp/for-21.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,104 @@ 
+// { dg-do compile { target c++17 } }
+
+void
+f1 (int a[10][10])
+{
+  #pragma omp for collapse (2)
+  for (int i = 0; i < 10; ++i)
+    for (auto j : a[i])		// { dg-error "initializer expression refers to iteration variable 'i'" }
+      ;
+}
+
+void
+f2 (int (&a)[10])
+{
+  #pragma omp for collapse (2)
+  for (auto i : a)
+    for (int j = i * 2; j < i * 4; j++)		// { dg-error "initializer expression refers to iteration variable 'i'" }
+      ;
+}
+
+struct S { int a, b, c; };
+
+void
+f3 (S (&a)[10])
+{
+  #pragma omp for collapse (2)
+  for (auto [i, j, k] : a)			// { dg-error "use of 'i' before deduction of 'auto'" "" { target *-*-* } .+1 }
+    for (int l = i; l < j; l += k)		// { dg-error "use of 'j' before deduction of 'auto'" }
+      ;						// { dg-error "use of 'k' before deduction of 'auto'" "" { target *-*-* } .-1 }
+}
+
+template <int N>
+void
+f4 (int a[10][10])
+{
+  #pragma omp for collapse (2)
+  for (int i = 0; i < 10; ++i)		// { dg-error "initializer expression refers to iteration variable 'i'" }
+    for (auto j : a[i])
+      ;
+}
+
+template <int N>
+void
+f5 (int (&a)[10])
+{
+  #pragma omp for collapse (2)
+  for (auto i : a)
+    for (int j = i * 2; j < i * 4; j++)		// { dg-error "initializer expression refers to iteration variable 'i'" }
+      ;
+}
+
+template <int N>
+void
+f6 (S (&a)[10])
+{
+  #pragma omp for collapse (2)
+  for (auto [i, j, k] : a)			// { dg-error "use of 'i' before deduction of 'auto'" "" { target *-*-* } .-1 }
+    for (int l = i; l < j; l += k)		// { dg-error "use of 'j' before deduction of 'auto'" }
+      ;						// { dg-error "use of 'k' before deduction of 'auto'" "" { target *-*-* } .-3 }
+}
+
+template <typename T>
+void
+f7 (T a[10][10])
+{
+  #pragma omp for collapse (2)
+  for (T i = 0; i < 10; ++i)
+    for (auto j : a[i])		// { dg-error "initializer expression refers to iteration variable 'i'" }
+      ;
+}
+
+template <typename T>
+void
+f8 (T (&a)[10])
+{
+  #pragma omp for collapse (2)
+  for (auto i : a)
+    for (T j = i * 2; j < i * 4; j++)		// { dg-error "initializer expression refers to iteration variable 'i'" }
+      ;
+}
+
+template <typename T, typename U>
+void
+f9 (U (&a)[10])
+{
+  #pragma omp for collapse (2)
+  for (auto [i, j, k] : a)			// { dg-error "use of 'i' before deduction of 'auto'" "" { target *-*-* } .-1 }
+    for (T l = i; l < j; l += k)		// { dg-error "use of 'j' before deduction of 'auto'" }
+      ;						// { dg-error "use of 'k' before deduction of 'auto'" "" { target *-*-* } .-3 }
+}
+
+void
+test ()
+{
+  int a[10][10] {};
+  int b[10] {};
+  S c[10] {};
+  f4 <0> (a);
+  f5 <0> (b);
+  f6 <0> (c);
+  f7 (a);
+  f8 (b);
+  f9 <int, S> (c);
+}
--- gcc/testsuite/g++.dg/gomp/for-4.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/for-4.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -12,5 +12,5 @@  void foo (int n)
     bar(i);
 }
 
-/* { dg-final { scan-tree-dump-times "GOMP_loop_dynamic_start" 1 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_loop_dynamic_next" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_nonmonotonic_dynamic_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_nonmonotonic_dynamic_next" 1 "ompexp" } } */
--- gcc/testsuite/g++.dg/gomp/for-5.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/for-5.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -12,5 +12,5 @@  void foo (int n)
     bar(i);
 }
 
-/* { dg-final { scan-tree-dump-times "GOMP_loop_guided_start" 1 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_loop_guided_next" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_nonmonotonic_guided_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_nonmonotonic_guided_next" 1 "ompexp" } } */
--- gcc/testsuite/g++.dg/gomp/for-6.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/for-6.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -12,5 +12,5 @@  void foo (int n)
     bar(i);
 }
 
-/* { dg-final { scan-tree-dump-times "GOMP_loop_runtime_start" 1 "ompexp" } } */
-/* { dg-final { scan-tree-dump-times "GOMP_loop_runtime_next" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_maybe_nonmonotonic_runtime_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_maybe_nonmonotonic_runtime_next" 1 "ompexp" } } */
--- gcc/testsuite/g++.dg/gomp/loop-4.C	(.../trunk)	(nonexistent)
+++ gcc/testsuite/g++.dg/gomp/loop-4.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,227 @@ 
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+
+template <typename T>
+class I
+{
+public:
+  typedef ptrdiff_t difference_type;
+  I ();
+  ~I ();
+  I (T *);
+  I (const I &);
+  T &operator * ();
+  T *operator -> ();
+  T &operator [] (const difference_type &) const;
+  I &operator = (const I &);
+  I &operator ++ ();
+  I operator ++ (int);
+  I &operator -- ();
+  I operator -- (int);
+  I &operator += (const difference_type &);
+  I &operator -= (const difference_type &);
+  I operator + (const difference_type &) const;
+  I operator - (const difference_type &) const;
+  template <typename S> friend bool operator == (I<S> &, I<S> &);
+  template <typename S> friend bool operator == (const I<S> &, const I<S> &);
+  template <typename S> friend bool operator < (I<S> &, I<S> &);
+  template <typename S> friend bool operator < (const I<S> &, const I<S> &);
+  template <typename S> friend bool operator <= (I<S> &, I<S> &);
+  template <typename S> friend bool operator <= (const I<S> &, const I<S> &);
+  template <typename S> friend bool operator > (I<S> &, I<S> &);
+  template <typename S> friend bool operator > (const I<S> &, const I<S> &);
+  template <typename S> friend bool operator >= (I<S> &, I<S> &);
+  template <typename S> friend bool operator >= (const I<S> &, const I<S> &);
+  template <typename S> friend typename I<S>::difference_type operator - (I<S> &, I<S> &);
+  template <typename S> friend typename I<S>::difference_type operator - (const I<S> &, const I<S> &);
+  template <typename S> friend I<S> operator + (typename I<S>::difference_type , const I<S> &);
+private:
+  T *p;
+};
+
+template <typename T> bool operator == (I<T> &, I<T> &);
+template <typename T> bool operator == (const I<T> &, const I<T> &);
+template <typename T> bool operator != (I<T> &, I<T> &);
+template <typename T> bool operator != (const I<T> &, const I<T> &);
+template <typename T> bool operator < (I<T> &, I<T> &);
+template <typename T> bool operator < (const I<T> &, const I<T> &);
+template <typename T> bool operator <= (I<T> &, I<T> &);
+template <typename T> bool operator <= (const I<T> &, const I<T> &);
+template <typename T> bool operator > (I<T> &, I<T> &);
+template <typename T> bool operator > (const I<T> &, const I<T> &);
+template <typename T> bool operator >= (I<T> &, I<T> &);
+template <typename T> bool operator >= (const I<T> &, const I<T> &);
+template <typename T> typename I<T>::difference_type operator - (I<T> &, I<T> &);
+template <typename T> typename I<T>::difference_type operator - (const I<T> &, const I<T> &);
+template <typename T> I<T> operator + (typename I<T>::difference_type, const I<T> &);
+
+ptrdiff_t foo (I<int> &);
+I<int> &bar (I<int> &);
+I<int> &baz (I<int> *);
+
+void
+f0 ()
+{
+  int i;
+  const int j = 1;
+  const int k = -1;
+  const int m = 2;
+  const int n = -7;
+  int o = 1;
+  int p = -1;
+  #pragma omp for
+  for (i = 0; i != 64; i += j)
+    ;
+  #pragma omp for
+  for (i = 64; i != 0; i -= j)
+    ;
+  #pragma omp for
+  for (i = 0; i != 64; i -= k)
+    ;
+  #pragma omp for
+  for (i = 64; i != 0; i += k)
+    ;
+  #pragma omp for
+  for (i = 0; i != 64; i += m)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = 64; i != 0; i -= m)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = 0; i != 64; i -= n)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = 64; i != 0; i += n)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = 0; i != 64; i += o)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = 64; i != 0; i -= o)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = 0; i != 64; i -= p)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = 64; i != 0; i += p)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+}
+
+void
+f1 (I<int> &x, I<int> &y, I<int> &u, I<int> &v)
+{
+  I<int> i, j;
+  const int k = 1;
+  const int l = -1;
+  const int m = 2;
+  const int n = -7;
+  int o = 1;
+  int p = -1;
+  #pragma omp for
+  for (i = x; i != y; i++)
+    ;
+  #pragma omp for
+  for (i = x; y != i; ++i)
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = i + 1)
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = 1 + i)
+    ;
+  #pragma omp for
+  for (i = y; i != x; i--)
+    ;
+  #pragma omp for
+  for (i = y; x != i; --i)
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = i - 1)
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = -1 + i)
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = i + k)
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = k + i)
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = i - k)
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = -k + i)
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = i - l)
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = -l + i)
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = i + l)
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = l + i)
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = i + 2)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = 7 + i)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = i - 2)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = -7 + i)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = i + m)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = m + i)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = i - m)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = -m + i)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = i - n)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = -n + i)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = i + n)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = n + i)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = i + o)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = o + i)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = i - o)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = -o + i)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = i - p)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = x; i != y; i = -p + i)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = i + p)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+  #pragma omp for
+  for (i = y; i != x; i = p + i)	// { dg-error "increment is not constant 1 or -1 for != condition" }
+    ;
+}
--- gcc/testsuite/g++.dg/gomp/member-2.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/member-2.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -60,17 +60,17 @@  B::m1 ()
 int
 B::m2 ()
 {
-  #pragma omp parallel private (h)	// { dg-error "is predetermined .shared. for .private." }
+  #pragma omp parallel private (h)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     ;
   #pragma omp parallel firstprivate (h)
     ;
-  #pragma omp parallel for lastprivate (h)	// { dg-error "is predetermined .shared. for .lastprivate." }
+  #pragma omp parallel for lastprivate (h)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     for (int i = 0; i < 10; i++)
       ;
-  #pragma omp simd linear (h : 1)	// { dg-error "is predetermined .shared. for .linear." }
+  #pragma omp simd linear (h : 1)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     for (int i = 0; i < 10; i++)
       ;
-  #pragma omp parallel for reduction (+:h)	// { dg-error "is predetermined .shared. for .reduction." }
+  #pragma omp parallel for reduction (+:h)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     for (int i = 0; i < 10; i++)
       ;
   #pragma omp parallel for reduction (+:g)	// { dg-error "has const type for .reduction." }
@@ -88,7 +88,7 @@  B::m2 ()
     ;
   #pragma omp parallel shared (g)
     ;
-  #pragma omp parallel shared (h)	// { dg-error "is predetermined .shared. for .shared." }
+  #pragma omp parallel shared (h)
     ;
   return 0;
 }
@@ -118,30 +118,30 @@  B::m3 () const
 int
 B::m4 () const
 {
-  #pragma omp parallel private (a)	// { dg-error "is predetermined .shared. for .private." }
+  #pragma omp parallel private (a)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     ;
   #pragma omp parallel firstprivate (a)
     ;
-  #pragma omp parallel for lastprivate (a)	// { dg-error "is predetermined .shared. for .lastprivate." }
+  #pragma omp parallel for lastprivate (a)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     for (int i = 0; i < 10; i++)
       ;
-  #pragma omp simd linear (a : 1)	// { dg-error "is predetermined .shared. for .linear." }
+  #pragma omp simd linear (a : 1)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     for (int i = 0; i < 10; i++)
       ;
-  #pragma omp parallel for reduction (+:a)	// { dg-error "is predetermined .shared. for .reduction." }
+  #pragma omp parallel for reduction (+:a)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     for (int i = 0; i < 10; i++)
       ;
-  #pragma omp parallel private (h)	// { dg-error "is predetermined .shared. for .private." }
+  #pragma omp parallel private (h)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     ;
   #pragma omp parallel firstprivate (h)
     ;
-  #pragma omp parallel for lastprivate (h)	// { dg-error "is predetermined .shared. for .lastprivate." }
+  #pragma omp parallel for lastprivate (h)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     for (int i = 0; i < 10; i++)
       ;
-  #pragma omp simd linear (h : 1)	// { dg-error "is predetermined .shared. for .linear." }
+  #pragma omp simd linear (h : 1)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     for (int i = 0; i < 10; i++)
       ;
-  #pragma omp parallel for reduction (+:h)	// { dg-error "is predetermined .shared. for .reduction." }
+  #pragma omp parallel for reduction (+:h)	// { dg-error "may appear only in .shared. or .firstprivate. clauses" }
     for (int i = 0; i < 10; i++)
       ;
   #pragma omp parallel for reduction (+:e)	// { dg-error "has const type for .reduction." }
@@ -150,7 +150,7 @@  B::m4 () const
   #pragma omp parallel for reduction (+:g)	// { dg-error "has const type for .reduction." }
     for (int i = 0; i < 10; i++)
       ;
-  #pragma omp parallel shared (a)	// { dg-error "is predetermined .shared. for .shared." }
+  #pragma omp parallel shared (a)
     ;
   #pragma omp parallel shared (b)
     ;
@@ -162,7 +162,7 @@  B::m4 () const
     ;
   #pragma omp parallel shared (g)
     ;
-  #pragma omp parallel shared (h)	// { dg-error "is predetermined .shared. for .shared." }
+  #pragma omp parallel shared (h)
     ;
   return 0;
 }
--- gcc/testsuite/g++.dg/gomp/pr33372-1.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/pr33372-1.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -8,8 +8,8 @@  void f ()
   extern T n ();
 #pragma omp parallel num_threads(n)	// { dg-error "'num_threads' expression must be integral" }
   ;
-#pragma omp parallel for schedule(static, n)
-  for (int i = 0; i < 10; i++)		// { dg-error "chunk size expression must be integral" }
+#pragma omp parallel for schedule(static, n)	// { dg-error "chunk size expression must be integral" }
+  for (int i = 0; i < 10; i++)
     ;
 }
 
--- gcc/testsuite/g++.dg/gomp/pr33372-3.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/pr33372-3.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -8,8 +8,8 @@  void f ()
   T n = 6;
 #pragma omp parallel num_threads(n)	// { dg-error "'num_threads' expression must be integral" }
   ;
-#pragma omp parallel for schedule(static, n)
-  for (int i = 0; i < 10; i++)		// { dg-error "chunk size expression must be integral" }
+#pragma omp parallel for schedule(static, n)	// { dg-error "chunk size expression must be integral" }
+  for (int i = 0; i < 10; i++)
     ;
 }
 
--- gcc/testsuite/g++.dg/gomp/pr39495-2.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/pr39495-2.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -13,25 +13,25 @@  foo (void)
   unsigned int u;
 
 #pragma omp for
-  for (i = INT_MIN + 6; i != INT_MIN; i--)	// { dg-error "invalid controlling predicate" }
+  for (i = INT_MIN + 6; i != INT_MIN; i--)
     ;
 #pragma omp for
   for (i = INT_MIN + 6; i == INT_MIN; i--)	// { dg-error "invalid controlling predicate" }
     ;
 #pragma omp for
-  for (i = INT_MAX - 6; i != INT_MAX; i++)	// { dg-error "invalid controlling predicate" }
+  for (i = INT_MAX - 6; i != INT_MAX; i++)
     ;
 #pragma omp for
   for (i = INT_MAX - 6; i == INT_MAX; i++)	// { dg-error "invalid controlling predicate" }
     ;
 #pragma omp for
-  for (u = 6; u != 0; u--)			// { dg-error "invalid controlling predicate" }
+  for (u = 6; u != 0; u--)
     ;
 #pragma omp for
   for (u = 6; u == 0; u--)			// { dg-error "invalid controlling predicate" }
     ;
 #pragma omp for
-  for (u = UINT_MAX - 6; u != UINT_MAX; u++)	// { dg-error "invalid controlling predicate" }
+  for (u = UINT_MAX - 6; u != UINT_MAX; u++)
     ;
 #pragma omp for
   for (u = UINT_MAX - 6; u == UINT_MAX; u++)	// { dg-error "invalid controlling predicate" }
--- gcc/testsuite/g++.dg/gomp/predetermined-1.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/predetermined-1.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -15,18 +15,18 @@  const A foo (const A d, const C e)
   const A f;
   const B b = { 4 };
   A g;
-  #pragma omp parallel default (none)
-    bar (&a);
-  #pragma omp parallel default (none)
-    bar (&b);
+  #pragma omp parallel default (none)	// { dg-error "enclosing 'parallel'" }
+    bar (&a);				// { dg-error "not specified" }
+  #pragma omp parallel default (none)	// { dg-error "enclosing 'parallel'" }
+    bar (&b);				// { dg-error "not specified" }
   #pragma omp parallel default (none)	// { dg-error "enclosing 'parallel'" }
     bar (&c);				// { dg-error "not specified" }
-  #pragma omp parallel default (none)
-    bar (&d);
+  #pragma omp parallel default (none)	// { dg-error "enclosing 'parallel'" }
+    bar (&d);				// { dg-error "not specified" }
   #pragma omp parallel default (none)	// { dg-error "enclosing 'parallel'" }
     bar (&e);				// { dg-error "not specified" }
-  #pragma omp parallel default (none)
-    bar (&f);
+  #pragma omp parallel default (none)	// { dg-error "enclosing 'parallel'" }
+    bar (&f);				// { dg-error "not specified" }
   #pragma omp parallel default (none)	// { dg-error "enclosing 'parallel'" }
     bar (&g);				// { dg-error "not specified" }
   return f;
--- gcc/testsuite/g++.dg/gomp/private-1.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/private-1.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -15,17 +15,17 @@  const A foo (const A d, const C e)
   const A f;
   const B b = { 4 };
   A g;
-  #pragma omp parallel private (a)	// { dg-error "predetermined" }
+  #pragma omp parallel private (a)	// { dg-error "may appear only in 'shared' or 'firstprivate' clauses" }
     bar (&a);
-  #pragma omp parallel private (b)	// { dg-error "predetermined" }
+  #pragma omp parallel private (b)	// { dg-error "may appear only in 'shared' or 'firstprivate' clauses" }
     bar (&b);
   #pragma omp parallel private (c)
     bar (&c);
-  #pragma omp parallel private (d)	// { dg-error "predetermined" }
+  #pragma omp parallel private (d)	// { dg-error "may appear only in 'shared' or 'firstprivate' clauses" }
     bar (&d);
   #pragma omp parallel private (e)
     bar (&e);
-  #pragma omp parallel private (f)	// { dg-error "predetermined" }
+  #pragma omp parallel private (f)	// { dg-error "may appear only in 'shared' or 'firstprivate' clauses" }
     bar (&f);
   #pragma omp parallel private (g)
     bar (&g);
--- gcc/testsuite/g++.dg/gomp/sharing-1.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/sharing-1.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -61,7 +61,7 @@  main (void)
       thrglobalvar++;	/* Predetermined - threadprivate.  */
       thrlocvar++;	/* Predetermined - threadprivate.  */
       foo (i);		/* Predetermined - private (omp for loop variable).  */
-      foo (constvar.x);	/* Predetermined - shared (const qualified type).  */
+      foo (constvar.x);	/* { dg-error "not specified in" } */
       foo (T::t.i);	/* Predetermined - shared (static data member).  */
       foo (*p);		/* *p predetermined - shared (heap allocated */
       (*p)++;		/* storage).  */
--- gcc/testsuite/g++.dg/gomp/sharing-2.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/sharing-2.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -5,15 +5,21 @@  struct T
   int i;
   mutable int j;
 };
+struct U
+{
+  int i, j;
+};
 struct S
 {
   const static int d = 1;
   const static T e;
+  const static U f;
   void foo (int, T);
 };
 
 const int S::d;
 const T S::e = { 2, 3 };
+const U S::f = { 4, 5 };
 
 void bar (const int &);
 
@@ -28,15 +34,19 @@  S::foo (const int x, const T y)
     bar (y.i);
   #pragma omp parallel firstprivate (e)	// { dg-error "is predetermined" }
     bar (e.i);
-  #pragma omp parallel shared (x)	// { dg-error "is predetermined" }
+  #pragma omp parallel firstprivate (f)
+    bar (f.i);
+  #pragma omp parallel shared (x)
     bar (x);
   #pragma omp parallel shared (d)	// { dg-error "is predetermined" }
     bar (d);
   #pragma omp parallel shared (e)	// { dg-error "is predetermined" }
     bar (e.i);
+  #pragma omp parallel shared (f)	// { dg-error "is predetermined" }
+    bar (f.i);
   #pragma omp parallel shared (y)
     bar (y.i);
-  #pragma omp parallel private (x)	// { dg-error "is predetermined" }
+  #pragma omp parallel private (x)	// { dg-error "may appear only in 'shared' or 'firstprivate' clauses" }
     bar (x);
   #pragma omp parallel private (d)	// { dg-error "is predetermined" }
     bar (d);
@@ -44,4 +54,6 @@  S::foo (const int x, const T y)
     bar (y.i);
   #pragma omp parallel private (e)	// { dg-error "is predetermined" }
     bar (e.i);
+  #pragma omp parallel private (f)	// { dg-error "is predetermined" }
+    bar (f.i);
 }
--- gcc/testsuite/g++.dg/gomp/simd-2.C	(.../trunk)	(nonexistent)
+++ gcc/testsuite/g++.dg/gomp/simd-2.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -0,0 +1,21 @@ 
+int a[32], b[32];
+
+void
+foo (void)
+{
+  int i, j;
+  #pragma omp simd linear(i, j) collapse(2)	// { dg-error "iteration variable 'i' should not be linear" }
+  for (i = 0; i < 32; ++i)			// { dg-error "iteration variable 'j' should not be linear" "" { target *-*-* } .-1 }
+    for (j = 0; j < 32; ++j)
+      a[i] += b[j];
+}
+
+void
+bar (void)
+{
+  static int i, j;
+  #pragma omp for simd linear(i, j) collapse(2)	// { dg-error "iteration variable 'i' should not be linear" "" { target *-*-* } .+1 }
+  for (i = 0; i < 32; ++i)			// { dg-error "iteration variable 'j' should not be linear" }
+    for (j = 0; j < 32; ++j)
+      a[i] += b[j];
+}
--- gcc/testsuite/g++.dg/gomp/tpl-atomic-2.C	(.../trunk)	(revision 265884)
+++ gcc/testsuite/g++.dg/gomp/tpl-atomic-2.C	(.../branches/gomp-5_0-branch)	(revision 265887)
@@ -6,21 +6,21 @@  struct S { int x; } s;
 // even when the templates are never instantiated.
 template<typename T> void f1()
 {
-  #pragma omp atomic
-  s += 1;		// { dg-error "invalid" }
+  #pragma omp atomic	// { dg-error "invalid" }
+  s += 1;
 }
 
 template<typename T> void f2(float *f)
 {
-  #pragma omp atomic
-  *f |= 1;		// { dg-error "invalid|evaluation" }
+  #pragma omp atomic	// { dg-error "invalid" }
+  *f |= 1;		// { dg-error "evaluation" }
 }
 
 // Here the rhs is dependent, but not type dependent.
 template<typename T> void f3(float *f)
 {
-  #pragma omp atomic
-  *f |= sizeof (T);	// { dg-error "invalid|evaluation" }
+  #pragma omp atomic	// { dg-error "invalid" }
+  *f |= sizeof (T);	// { dg-error "evaluation" }
 }
 
 // And the converse, no error here because we're never fed a T.
@@ -35,6 +35,6 @@  template<typename T> void f4(T *t)
 // of the semantic analysis concurrent with that.
 template<typename T> void f5(float *f)
 {
-  #pragma omp atomic
-  *f |= (T)sizeof(T);	// { dg-error "invalid|evaluation" "" { xfail *-*-* } }
+  #pragma omp atomic	// { dg-error "invalid" "" { xfail *-*-* } }
+  *f |= (T)sizeof(T);	// { dg-error "evaluation" "" { xfail *-*-* } }
 }