summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c11
-rw-r--r--gcc/testsuite/gcc.dg/gomp/atomic-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/clause-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/gomp/combined-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/gomp/for-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/gomp/for-5.c4
-rw-r--r--gcc/testsuite/gcc.dg/gomp/for-6.c4
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr39495-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/gomp/reduction-2.c30
-rw-r--r--gcc/testsuite/gcc.dg/gomp/sharing-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/simd-1.c21
-rw-r--r--gcc/testsuite/gcc.dg/gomp/teams-1.c4
12 files changed, 76 insertions, 47 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
index e0f0eca2fa5..099f03fe89d 100644
--- a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
+++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
@@ -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 } */
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-5.c b/gcc/testsuite/gcc.dg/gomp/atomic-5.c
index 68ead29b86d..70cfb35f470 100644
--- a/gcc/testsuite/gcc.dg/gomp/atomic-5.c
+++ b/gcc/testsuite/gcc.dg/gomp/atomic-5.c
@@ -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
diff --git a/gcc/testsuite/gcc.dg/gomp/clause-1.c b/gcc/testsuite/gcc.dg/gomp/clause-1.c
index c2d1fc69ed4..9d34b041606 100644
--- a/gcc/testsuite/gcc.dg/gomp/clause-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/clause-1.c
@@ -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++)
;
}
diff --git a/gcc/testsuite/gcc.dg/gomp/combined-1.c b/gcc/testsuite/gcc.dg/gomp/combined-1.c
index 0c0848c5e7c..e69de29bb2d 100644
--- a/gcc/testsuite/gcc.dg/gomp/combined-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/combined-1.c
@@ -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" } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/for-4.c b/gcc/testsuite/gcc.dg/gomp/for-4.c
index 989d4b2a8f3..d3351f5a609 100644
--- a/gcc/testsuite/gcc.dg/gomp/for-4.c
+++ b/gcc/testsuite/gcc.dg/gomp/for-4.c
@@ -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" } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/for-5.c b/gcc/testsuite/gcc.dg/gomp/for-5.c
index fca2697c9a4..3bc8d514ad0 100644
--- a/gcc/testsuite/gcc.dg/gomp/for-5.c
+++ b/gcc/testsuite/gcc.dg/gomp/for-5.c
@@ -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" } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/for-6.c b/gcc/testsuite/gcc.dg/gomp/for-6.c
index 9f9db4102fd..9762be6fd06 100644
--- a/gcc/testsuite/gcc.dg/gomp/for-6.c
+++ b/gcc/testsuite/gcc.dg/gomp/for-6.c
@@ -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" } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/pr39495-2.c b/gcc/testsuite/gcc.dg/gomp/pr39495-2.c
index a276c24ed98..c0b05cbe9b3 100644
--- a/gcc/testsuite/gcc.dg/gomp/pr39495-2.c
+++ b/gcc/testsuite/gcc.dg/gomp/pr39495-2.c
@@ -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" } */
diff --git a/gcc/testsuite/gcc.dg/gomp/reduction-2.c b/gcc/testsuite/gcc.dg/gomp/reduction-2.c
new file mode 100644
index 00000000000..f8ac8b6bbfe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/reduction-2.c
@@ -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);
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/sharing-1.c b/gcc/testsuite/gcc.dg/gomp/sharing-1.c
index 0e2b60fc0d5..79abb64cdd7 100644
--- a/gcc/testsuite/gcc.dg/gomp/sharing-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/sharing-1.c
@@ -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. */
diff --git a/gcc/testsuite/gcc.dg/gomp/simd-1.c b/gcc/testsuite/gcc.dg/gomp/simd-1.c
new file mode 100644
index 00000000000..00aa159eafa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/simd-1.c
@@ -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];
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/teams-1.c b/gcc/testsuite/gcc.dg/gomp/teams-1.c
index a5370470cde..db7f50b2cde 100644
--- a/gcc/testsuite/gcc.dg/gomp/teams-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/teams-1.c
@@ -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:; }
}
}