i = 0;
}
}
+
+void
+f_acc_serial (void)
+{
+#pragma acc serial
+ /* { dg-note {variable 'i' declared in block is candidate for adjusting OpenACC privatization level} "" { target *-*-* } .-1 }
+ { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'gang'} "" { target *-*-* } .-2 } */
+ {
+ int i;
+#pragma omp atomic write
+ i = 0;
+ }
+}
;
#pragma acc kernels /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
+#pragma acc serial /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
+ ;
#pragma acc data /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc update host(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc kernels /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
+#pragma acc serial /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
+ ;
#pragma acc data /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc update host(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
}
#pragma omp section
{
+#pragma acc serial /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
+ ;
+ }
+#pragma omp section
+ {
#pragma acc data /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
}
;
#pragma acc kernels /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
+#pragma acc serial /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
+ ;
#pragma acc data /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc update host(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc kernels /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
+#pragma acc serial /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
+ ;
#pragma acc data /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc update host(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc kernels /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
+#pragma acc serial /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
+ ;
#pragma acc data /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc update host(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc kernels /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
+#pragma acc serial /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
+ ;
#pragma acc data /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc update host(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc kernels /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
+#pragma acc serial /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
+ ;
#pragma acc data /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc update host(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
;
#pragma acc kernels /* { dg-error "OpenACC .kernels. construct inside of OpenMP .target. region" } */
;
+#pragma acc serial /* { dg-error "OpenACC .serial. construct inside of OpenMP .target. region" } */
+ ;
#pragma acc data /* { dg-error "OpenACC .data. construct inside of OpenMP .target. region" } */
;
#pragma acc update host(i) /* { dg-error "OpenACC .update. construct inside of OpenMP .target. region" } */
}
}
+void
+f_acc_serial (void)
+{
+#pragma acc serial
+ {
+#pragma omp parallel /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ ;
+ }
+
+#pragma acc serial
+ {
+#pragma omp for /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ for (i = 0; i < 3; i++)
+ ;
+ }
+
+#pragma acc serial
+ {
+#pragma omp sections /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ {
+ ;
+ }
+ }
+
+#pragma acc serial
+ {
+#pragma omp single /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ ;
+ }
+
+#pragma acc serial
+ {
+#pragma omp task /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ ;
+ }
+
+#pragma acc serial
+ {
+#pragma omp master /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ ;
+ }
+
+#pragma acc serial
+ {
+#pragma omp critical /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ ;
+ }
+
+#pragma acc serial
+ {
+#pragma omp ordered /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ ;
+ }
+
+#pragma acc serial
+ {
+#pragma omp target /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ ;
+#pragma omp target data map(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ ;
+#pragma omp target update to(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+ }
+}
+
void
f_acc_data (void)
{
else
baz2 ();
+ if (a) /* { dg-warning "ambiguous" } */
+ #pragma acc serial
+ if (b)
+ bar2 ();
+ else
+ baz2 ();
+
+ if (a) /* { dg-warning "ambiguous" } */
+ #pragma acc serial loop
+ for (i = 0; i < 10; i++)
+ if (b)
+ bar2 ();
+ else
+ baz2 ();
+
(void) d[0];
if (a)
}
if (a)
- {
- #pragma acc parallel loop
- for (i = 0; i < 10; i++)
+ #pragma acc serial
+ {
if (b)
bar2 ();
else
baz2 ();
- }
+ }
+
+ if (a)
+ #pragma acc serial loop
+ for (i = 0; i < 10; i++)
+ {
+ if (b)
+ bar2 ();
+ else
+ baz2 ();
+ }
}
#pragma acc routine vector
#pragma acc routine
int
-foo (void)
+foo_routine (void)
{
int res;
/* { dg-note {'res' was declared here} {} { target *-*-* } .-1 } */
}
void
-foo2 (void)
+foo_parallel (void)
{
int res;
}
void
-foo3 (void)
+foo_kernels (void)
{
int res;
res += __builtin_goacc_parlevel_size (GOMP_DIM_VECTOR);
}
}
+
+void
+foo_serial (void)
+{
+ int res;
+
+#pragma acc serial
+ /* implicit 'firstprivate (res)'
+ { dg-warning {'res' is used uninitialized} TODO { xfail *-*-* } .-2 } */
+ {
+ __builtin_goacc_parlevel_id (GOMP_DIM_GANG);
+ __builtin_goacc_parlevel_id (GOMP_DIM_WORKER);
+ __builtin_goacc_parlevel_id (GOMP_DIM_VECTOR);
+
+ __builtin_goacc_parlevel_size (GOMP_DIM_GANG);
+ __builtin_goacc_parlevel_size (GOMP_DIM_WORKER);
+ __builtin_goacc_parlevel_size (GOMP_DIM_VECTOR);
+
+ res += __builtin_goacc_parlevel_id (GOMP_DIM_GANG);
+ res += __builtin_goacc_parlevel_id (GOMP_DIM_WORKER);
+ res += __builtin_goacc_parlevel_id (GOMP_DIM_VECTOR);
+
+ res += __builtin_goacc_parlevel_size (GOMP_DIM_GANG);
+ res += __builtin_goacc_parlevel_size (GOMP_DIM_WORKER);
+ res += __builtin_goacc_parlevel_size (GOMP_DIM_VECTOR);
+ }
+}
for (i = 0; i < 100; i++)
a++;
+
+#pragma acc serial loop vector copy(a[0:100]) reduction(+:a) /* { dg-error "'a' does not have pointer or array type" } */
+ for (i = 0; i < 100; i++)
+ a++;
+
+
return a;
}
for (z = 0; z < 10; z++)
;
+
+#pragma acc serial loop seq auto /* { dg-error "'seq' overrides other OpenACC loop specifiers" } */
+ for (x = 0; x < 10; x++)
+#pragma acc loop
+ for (y = 0; y < 10; y++)
+ ;
+
+#pragma acc serial loop gang auto /* { dg-error "'auto' conflicts with other OpenACC loop specifiers" } */
+ for (x = 0; x < 10; x++)
+#pragma acc loop worker auto /* { dg-error "'auto' conflicts with other OpenACC loop specifiers" } */
+ for (y = 0; y < 10; y++)
+#pragma acc loop vector
+ for (z = 0; z < 10; z++)
+ ;
+
+
return 0;
}
{
int a[100], i, j, z;
+
// acc parallel
#pragma acc parallel loop collapse (2)
// for (i = 0; i < 100; i++)
// ;
+
// acc kernels
#pragma acc kernels loop collapse (2)
// #pragma acc kernels loop reduction (+:z) copy (z)
// for (i = 0; i < 100; i++)
+// ;
+
+
+ // acc serial
+
+ #pragma acc serial loop collapse (2)
+ for (i = 0; i < 100; i++)
+ for (j = 0; j < 10; j++)
+ ;
+
+ #pragma acc serial loop gang
+ for (i = 0; i < 100; i++)
+ ;
+
+ #pragma acc serial loop worker
+ for (i = 0; i < 100; i++)
+ for (j = 0; j < 10; j++)
+ ;
+
+ #pragma acc serial loop vector
+ for (i = 0; i < 100; i++)
+ for (j = 0; j < 10; j++)
+ ;
+
+ #pragma acc serial loop seq
+ for (i = 0; i < 100; i++)
+ for (j = 0; j < 10; j++)
+ ;
+
+ #pragma acc serial loop auto
+ for (i = 0; i < 100; i++)
+ for (j = 0; j < 10; j++)
+ ;
+
+ #pragma acc serial loop tile (2, 3)
+ for (i = 0; i < 100; i++)
+ for (j = 0; j < 10; j++)
+ ;
+
+ #pragma acc serial loop independent
+ for (i = 0; i < 100; i++)
+ ;
+
+ #pragma acc serial loop private (z)
+ for (i = 0; i < 100; i++)
+ z = 0;
+
+// #pragma acc serial loop reduction (+:z) copy (z)
+// for (i = 0; i < 100; i++)
// ;
}
-// { dg-final { scan-tree-dump-times "acc loop collapse.2. private.j. private.i" 2 "gimple" } }
-// { dg-final { scan-tree-dump-times "acc loop gang" 2 "gimple" } }
-// { dg-final { scan-tree-dump-times "acc loop worker" 2 "gimple" } }
-// { dg-final { scan-tree-dump-times "acc loop vector" 2 "gimple" } }
-// { dg-final { scan-tree-dump-times "acc loop seq" 2 "gimple" } }
-// { dg-final { scan-tree-dump-times "acc loop auto" 2 "gimple" } }
-// { dg-final { scan-tree-dump-times "acc loop tile.2, 3" 2 "gimple" } }
-// { dg-final { scan-tree-dump-times "acc loop independent private.i" 2 "gimple" } }
-// { dg-final { scan-tree-dump-times "private.z" 2 "gimple" } }
+
+// { dg-final { scan-tree-dump-times "acc loop collapse.2. private.j. private.i" 3 "gimple" } }
+// { dg-final { scan-tree-dump-times "acc loop gang" 3 "gimple" } }
+// { dg-final { scan-tree-dump-times "acc loop worker" 3 "gimple" } }
+// { dg-final { scan-tree-dump-times "acc loop vector" 3 "gimple" } }
+// { dg-final { scan-tree-dump-times "acc loop seq" 3 "gimple" } }
+// { dg-final { scan-tree-dump-times "acc loop auto" 3 "gimple" } }
+// { dg-final { scan-tree-dump-times "acc loop tile.2, 3" 3 "gimple" } }
+// { dg-final { scan-tree-dump-times "acc loop independent private.i" 3 "gimple" } }
+// { dg-final { scan-tree-dump-times "private.z" 3 "gimple" } }
/* { dg-do compile } */
/* { dg-options "-fopenacc -fdump-tree-gimple" } */
+/* See also '../../gfortran.dg/goacc/reduction-2.f95'. */
+
#include <assert.h>
int
assert (v1 == n);
+#pragma acc serial loop reduction(+:v1)
+ for (i = 0; i < n; i++)
+ v1++;
+
+ assert (v1 == n);
+
return 0;
}
/* { dg-final { scan-tree-dump-times "acc loop reduction.+:v1. private.i." 1 "gimple" } } */
/* { dg-final { scan-tree-dump-times "omp target oacc_kernels map.force_tofrom:n .len: 4.. map.force_tofrom:v1 .len: 4.." 1 "gimple" } } */
/* { dg-final { scan-tree-dump-times "acc loop reduction.+:v1. private.i." 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "omp target oacc_serial reduction.+:v1. map.tofrom:v1" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "acc loop reduction.+:v1. private.i." 1 "gimple" } } */
;
#pragma acc kernels present_or_copyin(fp[3]) present_or_copyout(fp[7:4]) /* { dg-error "'fp' appears more than once in data clauses" } */
;
+#pragma acc serial present(fp[0:2]) copyin(fp[0:2]) /* { dg-error "'fp' appears more than once in data clauses" } */
+ ;
#pragma acc data create(fp[:10]) deviceptr(fp) /* { dg-error "'fp' appears more than once in data clauses" } */
;
#pragma acc data create(fp) present(fp) /* { dg-error "'fp' appears more than once in data clauses" } */
;
#pragma acc parallel default (none)
;
+#pragma acc serial default (none)
+ ;
#pragma acc kernels default (present)
;
#pragma acc parallel default (present)
;
+#pragma acc serial default (present)
+ ;
}
;
#pragma acc parallel default /* { dg-error "expected .\\(. before end of line" } */
;
+#pragma acc serial default /* { dg-error "expected .\\(. before end of line" } */
+ ;
#pragma acc kernels default ( /* { dg-error "expected .none. or .present. before end of line" } */
;
#pragma acc parallel default ( /* { dg-error "expected .none. or .present. before end of line" } */
;
+#pragma acc serial default ( /* { dg-error "expected .none. or .present. before end of line" } */
+ ;
#pragma acc kernels default (, /* { dg-error "expected .none. or .present. before .,. token" } */
;
#pragma acc parallel default (, /* { dg-error "expected .none. or .present. before .,. token" } */
;
+#pragma acc serial default (, /* { dg-error "expected .none. or .present. before .,. token" } */
+ ;
#pragma acc kernels default () /* { dg-error "expected .none. or .present. before .\\). token" } */
;
#pragma acc parallel default () /* { dg-error "expected .none. or .present. before .\\). token" } */
;
+#pragma acc serial default () /* { dg-error "expected .none. or .present. before .\\). token" } */
+ ;
#pragma acc kernels default (,) /* { dg-error "expected .none. or .present. before .,. token" } */
;
#pragma acc parallel default (,) /* { dg-error "expected .none. or .present. before .,. token" } */
;
+#pragma acc serial default (,) /* { dg-error "expected .none. or .present. before .,. token" } */
+ ;
#pragma acc kernels default (firstprivate) /* { dg-error "expected .none. or .present. before .firstprivate." } */
;
#pragma acc parallel default (firstprivate) /* { dg-error "expected .none. or .present. before .firstprivate." } */
;
+#pragma acc serial default (firstprivate) /* { dg-error "expected .none. or .present. before .firstprivate." } */
+ ;
#pragma acc kernels default (private) /* { dg-error "expected .none. or .present. before .private." } */
;
#pragma acc parallel default (private) /* { dg-error "expected .none. or .present. before .private." } */
;
+#pragma acc serial default (private) /* { dg-error "expected .none. or .present. before .private." } */
+ ;
#pragma acc kernels default (shared) /* { dg-error "expected .none. or .present. before .shared." } */
;
#pragma acc parallel default (shared) /* { dg-error "expected .none. or .present. before .shared." } */
;
+#pragma acc serial default (shared) /* { dg-error "expected .none. or .present. before .shared." } */
+ ;
#pragma acc kernels default (none /* { dg-error "expected .\\). before end of line" } */
;
#pragma acc parallel default (none /* { dg-error "expected .\\). before end of line" } */
;
+#pragma acc serial default (none /* { dg-error "expected .\\). before end of line" } */
+ ;
#pragma acc kernels default (none none) /* { dg-error "expected .\\). before .none." } */
;
#pragma acc parallel default (none none) /* { dg-error "expected .\\). before .none." } */
;
+#pragma acc serial default (none none) /* { dg-error "expected .\\). before .none." } */
+ ;
#pragma acc kernels default (none, none) /* { dg-error "expected .\\). before .,. token" } */
;
#pragma acc parallel default (none, none) /* { dg-error "expected .\\). before .,. token" } */
;
+#pragma acc serial default (none, none) /* { dg-error "expected .\\). before .,. token" } */
+ ;
}
f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .parallel. construct" } */
= f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .parallel. construct" } */
}
+#pragma acc serial default (none) /* { dg-note "enclosing OpenACC 'serial' construct with 'default\\\(none\\\)' clause" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" } */
+ }
#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
#pragma acc kernels /* { dg-note "enclosing OpenACC 'kernels' construct and" } */
f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .parallel. construct" } */
= f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .parallel. construct" } */
}
+#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
+#pragma acc serial /* { dg-note "enclosing OpenACC 'serial' construct and" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" } */
+ }
#pragma acc data default (none)
+#pragma acc kernels default (none) /* { dg-note "enclosing OpenACC 'kernels' construct with 'default\\\(none\\\)' clause" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .kernels. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .kernels. construct" } */
+ }
+#pragma acc data default (none)
#pragma acc parallel default (none) /* { dg-note "enclosing OpenACC 'parallel' construct with 'default\\\(none\\\)' clause" } */
{
f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .parallel. construct" } */
= f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .parallel. construct" } */
}
+#pragma acc data default (none)
+#pragma acc serial default (none) /* { dg-note "enclosing OpenACC 'serial' construct with 'default\\\(none\\\)' clause" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" } */
+ }
#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
#pragma acc data
#pragma acc data
+#pragma acc kernels /* { dg-note "enclosing OpenACC 'kernels' construct and" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .kernels. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .kernels. construct" } */
+ }
+#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
+#pragma acc data
+#pragma acc data
#pragma acc parallel /* { dg-note "enclosing OpenACC 'parallel' construct and" } */
{
f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .parallel. construct" } */
= f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .parallel. construct" } */
}
+#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
+#pragma acc data
+#pragma acc data
+#pragma acc serial /* { dg-note "enclosing OpenACC 'serial' construct and" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" } */
+ }
+
+#pragma acc data
+#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
+#pragma acc data
+#pragma acc kernels /* { dg-note "enclosing OpenACC 'kernels' construct and" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .kernels. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .kernels. construct" } */
+ }
#pragma acc data
#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
#pragma acc data
= f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .parallel. construct" } */
}
#pragma acc data
+#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
+#pragma acc data
+#pragma acc serial /* { dg-note "enclosing OpenACC 'serial' construct and" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" } */
+ }
+
+#pragma acc data
+#pragma acc data
+#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
+#pragma acc kernels /* { dg-note "enclosing OpenACC 'kernels' construct and" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .kernels. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .kernels. construct" } */
+ }
+#pragma acc data
#pragma acc data
#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
#pragma acc parallel /* { dg-note "enclosing OpenACC 'parallel' construct and" } */
= f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .parallel. construct" } */
}
#pragma acc data
+#pragma acc data
+#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
+#pragma acc serial /* { dg-note "enclosing OpenACC 'serial' construct and" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" } */
+ }
+
+#pragma acc data
+#pragma acc data default (none)
+#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
+#pragma acc kernels /* { dg-note "enclosing OpenACC 'kernels' construct and" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .kernels. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .kernels. construct" } */
+ }
+#pragma acc data
#pragma acc data default (none)
#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
#pragma acc parallel /* { dg-note "enclosing OpenACC 'parallel' construct and" } */
f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .parallel. construct" } */
= f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .parallel. construct" } */
}
+#pragma acc data
+#pragma acc data default (none)
+#pragma acc data default (none) /* { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" } */
+#pragma acc serial /* { dg-note "enclosing OpenACC 'serial' construct and" } */
+ {
+ f1_b[0] /* { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" } */
+ = f1_a; /* { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" } */
+ }
}
{
f1_b[0] = f1_a;
}
+#pragma acc serial
+ /* { dg-final { scan-tree-dump-times "omp target oacc_serial map\\(tofrom:f1_b \[^\\)\]+\\) map\\(tofrom:f1_a" 1 "gimple" } } */
+ {
+ f1_b[0] = f1_a;
+ }
}
}
{
f2_b[0] = f2_a;
}
+#pragma acc serial default (none)
+ /* { dg-final { scan-tree-dump-times "omp target oacc_serial default\\(none\\) map\\(tofrom:f2_b \[^\\)\]+\\) map\\(tofrom:f2_a" 1 "gimple" } } */
+ {
+ f2_b[0] = f2_a;
+ }
}
}
{
f2__b[0] = f2__a;
}
+#pragma acc serial
+ /* { dg-final { scan-tree-dump-times "omp target oacc_serial map\\(tofrom:f2__b \[^\\)\]+\\) map\\(tofrom:f2__a" 1 "gimple" } } */
+ {
+ f2__b[0] = f2__a;
+ }
}
}
{
f3_b[0] = f3_a;
}
+#pragma acc serial default (present)
+ /* { dg-final { scan-tree-dump-times "omp target oacc_serial default\\(present\\) map\\(tofrom:f3_b \[^\\)\]+\\) map\\(tofrom:f3_a" 1 "gimple" } } */
+ {
+ f3_b[0] = f3_a;
+ }
}
}
{
f3__b[0] = f3__a;
}
+#pragma acc serial
+ /* { dg-final { scan-tree-dump-times "omp target oacc_serial map\\(tofrom:f3__b \[^\\)\]+\\) map\\(tofrom:f3__a" 1 "gimple" } } */
+ {
+ f3__b[0] = f3__a;
+ }
}
}
{
f1_b[0] = f1_a;
}
+#pragma acc serial default (present)
+ /* { dg-final { scan-tree-dump-times "omp target oacc_serial default\\(present\\) map\\(force_present:f1_b \[^\\)\]+\\) firstprivate\\(f1_a\\)" 1 "gimple" } } */
+ {
+ f1_b[0] = f1_a;
+ }
- /* { dg-final { scan-tree-dump-times "omp target oacc_data default\\(present\\)" 2 "gimple" } } */
+ /* { dg-final { scan-tree-dump-times "omp target oacc_data default\\(present\\)" 3 "gimple" } } */
#pragma acc data default (present)
#pragma acc kernels
/* { dg-final { scan-tree-dump-times "omp target oacc_kernels map\\(force_present:f1_d \[^\\)\]+\\) map\\(force_tofrom:f1_c" 1 "gimple" } } */
{
f1_d[0] = f1_c;
}
+#pragma acc data default (none)
+#pragma acc data default (none)
+#pragma acc data default (present)
+#pragma acc serial
+ /* { dg-final { scan-tree-dump-times "omp target oacc_serial map\\(force_present:f1_d \[^\\)\]+\\) firstprivate\\(f1_c\\)" 1 "gimple" } } */
+ {
+ f1_d[0] = f1_c;
+ }
}
{ dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_gang_single async\(-1\) num_gangs\(1\) map\(force_present:c \[len: [0-9]+\]\) if\(_[0-9]+\)$} 1 "omp_oacc_kernels_decompose" } } */
++c;
+#pragma acc serial if(c) copy(c)
+ ++c;
+
#pragma acc data if(c) copy(c)
++c;
+// See also 'parallel-1.c', 'serial-1.c'.
+
/* { dg-additional-options "-fopt-info-optimized-omp" } */
int
{
}
#pragma acc kernels loop
+ for(i = 1; i < 10; i++)
+ {
+ }
+ #pragma acc serial loop
for(i = 1; i < 10; i++)
{
}
--- /dev/null
+/* See also "../../gfortran.dg/goacc/loop-2-serial.f95". */
+
+void S(void)
+{
+ int i, j;
+
+#pragma acc serial
+ {
+#pragma acc loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang(static:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang(static:*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang // { dg-message "containing loop" }
+ for (i = 0; i < 10; i++)
+ {
+#pragma acc loop vector
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop worker
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop gang // { dg-error "inner loop uses same" }
+ for (j = 1; j < 10; j++)
+ { }
+ }
+#pragma acc loop seq gang // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop worker
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker // { dg-message "containing loop" 2 }
+ for (i = 0; i < 10; i++)
+ {
+#pragma acc loop vector
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop worker // { dg-error "inner loop uses same" }
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop gang // { dg-error "incorrectly nested" }
+ for (j = 1; j < 10; j++)
+ { }
+ }
+#pragma acc loop seq worker // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang worker
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop vector
+ for (i = 0; i < 10; i++)
+ { }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector // { dg-message "containing loop" 3 }
+ for (i = 0; i < 10; i++)
+ {
+#pragma acc loop vector // { dg-error "inner loop uses same" }
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop worker // { dg-error "incorrectly nested" }
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop gang // { dg-error "incorrectly nested" }
+ for (j = 1; j < 10; j++)
+ { }
+ }
+#pragma acc loop seq vector // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang vector
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker vector
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop seq auto // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+
+ }
+
+#pragma acc serial loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop gang
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop gang(static:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop gang(static:*)
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc serial loop seq gang // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc serial loop worker
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc serial loop seq worker // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop gang worker
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc serial loop vector
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc serial loop seq vector // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop gang vector
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop worker vector
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc serial loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop seq auto // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop gang auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop worker auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop vector auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+}
/* See also "../../gfortran.dg/goacc/loop-2-parallel-3.f95". */
-void par1 (void)
+void f1 (void)
{
int i, j;
}
}
-void p2 (void)
+void f2 (void)
{
int i, j;
--- /dev/null
+/* See also "../../gfortran.dg/goacc/loop-2-serial-3.f95". */
+
+void f1 (void)
+{
+ int i, j;
+
+#pragma acc serial
+ {
+#pragma acc loop gang(5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop gang(num:5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop worker(5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop worker(num:5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop vector(5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop vector(length:5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+ }
+}
+
+void f2 (void)
+{
+ int i, j;
+
+#pragma acc serial loop gang(5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop gang(num:5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc serial loop worker(5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop worker(num:5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc serial loop vector(5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc serial loop vector(length:5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+}
{ }
}
+
#pragma acc kernels default (none)
{
#pragma acc loop auto
{ }
}
+
+#pragma acc serial firstprivate (j) private (i)
+ {
+#pragma acc loop seq
+ for (i = 0; i < 10; i++)
+ { }
+ }
+
+#pragma acc serial default (none)
+ {
+#pragma acc loop auto private (j)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang(static:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang(static:*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop independent
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop seq
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang worker vector
+ for (i = 0; i < 10; i++)
+ { }
+ }
+
+
return 0;
}
--- /dev/null
+/* Test cases of nested 'reduction' clauses expected to compile cleanly. */
+
+/* See also 'gfortran.dg/goacc/nested-reductions-1-serial.f90'. */
+
+/* { dg-additional-options -Wuninitialized } */
+
+void acc_serial (void)
+{
+ int i, j, k, sum, diff;
+
+ #pragma acc serial
+ /* implicit 'copy (sum, diff)'
+ { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 } */
+ {
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop collapse(2) reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(+:sum)
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop collapse(2) reduction(+:sum)
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(+:sum)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum) reduction(-:diff)
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(+:sum)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(-:diff)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+ }
+}
+
+/* The same tests as above, but using a combined serial loop construct. */
+
+void acc_serial_loop (void)
+{
+ int i, j, k, l, sum, diff;
+
+ #pragma acc serial loop
+ /* implicit 'copy (sum, diff)'
+ { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 } */
+ for (int h = 0; h < 10; ++h)
+ {
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop collapse(2) reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(+:sum)
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop collapse(2) reduction(+:sum)
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(+:sum) // { dg-warning "insufficient partitioning available to parallelize loop" }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum) reduction(-:diff)
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(+:sum) // { dg-warning "insufficient partitioning available to parallelize loop" }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(-:diff) // { dg-warning "insufficient partitioning available to parallelize loop" }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+ }
+}
+
+/* The same tests as above, but now the outermost reduction clause is on
+ the serial region, not the outermost loop. */
+
+void acc_serial_reduction (void)
+{
+ int i, j, k, sum, diff;
+
+ #pragma acc serial reduction(+:sum)
+ /* implicit 'copy (sum, diff)'
+ { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 } */
+ {
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ for (i = 0; i < 10; i++)
+ #pragma acc loop
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(+:sum)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum) reduction(-:diff)
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(+:sum)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(-:diff)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(+:sum)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(-:diff)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(+:sum)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+ }
+}
+
+/* The same tests as above, but using a combined serial loop construct, and
+ the outermost reduction clause is on that one, not the outermost loop. */
+void acc_serial_loop_reduction (void)
+{
+ int i, j, k, sum, diff;
+
+ #pragma acc serial loop reduction(+:sum)
+ /* implicit 'copy (sum, diff)'
+ { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 } */
+ for (int h = 0; h < 10; ++h)
+ {
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ for (i = 0; i < 10; i++)
+ #pragma acc loop
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ for (i = 0; i < 10; i++)
+ for (j = 0; j < 10; j++)
+ #pragma acc loop
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(+:sum) // { dg-warning "insufficient partitioning available to parallelize loop" }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum) reduction(-:diff)
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(+:sum) // { dg-warning "insufficient partitioning available to parallelize loop" }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(-:diff) // { dg-warning "insufficient partitioning available to parallelize loop" }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(+:sum) // { dg-warning "insufficient partitioning available to parallelize loop" }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(-:diff) // { dg-warning "insufficient partitioning available to parallelize loop" }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(+:sum) // { dg-warning "insufficient partitioning available to parallelize loop" }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop // { dg-warning "insufficient partitioning available to parallelize loop" }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+ }
+}
--- /dev/null
+/* Test erroneous cases of nested 'reduction' clauses. */
+
+/* See also 'gfortran.dg/goacc/nested-reductions-2-serial.f90'. */
+
+/* { dg-additional-options -Wuninitialized } */
+
+void acc_serial (void)
+{
+ int i, j, k, l, sum, diff;
+
+ #pragma acc serial
+ /* implicit 'copy (sum, diff)'
+ { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 } */
+ {
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop collapse(2) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(+:sum)
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(+:sum)
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(*:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(*:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum) reduction(-:diff)
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(-:diff) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum) // { dg-warning "nested loop in reduction needs reduction clause for .diff." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+ }
+}
+
+/* The same tests as above, but using a combined serial loop construct. */
+
+void acc_serial_loop (void)
+{
+ int i, j, k, l, sum, diff;
+
+ #pragma acc serial loop
+ /* implicit 'copy (sum, diff)'
+ { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 } */
+ for (int h = 0; h < 10; ++h)
+ {
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop collapse(2) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(+:sum)
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(+:sum)
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(*:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum)
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(*:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum) reduction(-:diff)
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(-:diff) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum) // { dg-warning "nested loop in reduction needs reduction clause for .diff." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+ }
+}
+
+/* The same tests as above, but now the outermost reduction clause is on
+ the serial region, not the outermost loop. */
+void acc_serial_reduction (void)
+{
+ int i, j, k, l, sum, diff;
+
+ #pragma acc serial reduction(+:sum)
+ /* implicit 'copy (sum, diff)'
+ { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 } */
+ {
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop collapse(2) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(+:sum)
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(+:sum)
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(max:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(*:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(max:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." })
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(*:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(-:diff) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(-:diff) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum) // { dg-warning "nested loop in reduction needs reduction clause for .diff." }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+ }
+}
+
+/* The same tests as above, but using a combined serial loop construct, and
+ the outermost reduction clause is on that one, not the outermost loop. */
+void acc_serial_loop_reduction (void)
+{
+ int i, j, k, l, sum, diff;
+
+ #pragma acc serial loop reduction(+:sum)
+ /* implicit 'copy (sum, diff)'
+ { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 } */
+ for (int h = 0; h < 10; ++h)
+ {
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop collapse(2) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(+:sum)
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(+:sum)
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(max:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(*:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(max:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (i = 0; i < 10; i++)
+ #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." })
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (k = 0; k < 10; k++)
+ #pragma acc loop reduction(*:sum) // { dg-warning "conflicting reduction operations for .sum." }
+ for (l = 0; l < 10; l++)
+ sum = 1;
+
+ #pragma acc loop reduction(-:diff) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ for (i = 0; i < 10; i++)
+ {
+ #pragma acc loop reduction(-:diff) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(+:sum)
+ for (k = 0; k < 10; k++)
+ sum = 1;
+
+ #pragma acc loop reduction(+:sum) // { dg-warning "nested loop in reduction needs reduction clause for .diff." }
+ // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ for (j = 0; j < 10; j++)
+ #pragma acc loop reduction(-:diff)
+ for (k = 0; k < 10; k++)
+ diff = 1;
+ }
+ }
+}
}
+void
+f_acc_serial (void)
+{
+#pragma acc serial
+ {
+#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
+ /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
+ /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i }
+ { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop_i$c_loop_i } */
+ /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */
+ for (i = 0; i < 2; ++i)
+ ;
+ }
+}
+
+
void
f_acc_data (void)
{
;
}
+#pragma acc serial
+ ;
+
+#pragma acc serial
+ {
+#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
+ /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
+ /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i }
+ { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop_i$c_loop_i } */
+ /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */
+ for (i = 0; i < 2; ++i)
+ ;
+ }
+
#pragma acc data
;
;
}
+#pragma acc serial
+ ;
+
+#pragma acc serial
+ {
+#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
+ /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
+ /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i }
+ { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop_i$c_loop_i } */
+ /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */
+ for (i = 0; i < 2; ++i)
+ ;
+ }
+
#pragma acc data
;
caa[3][12] = ca[3] + caa[3][12];
}
+#pragma acc serial copyout(ca[3:4])
+ {
+ c = 9;
+ ca[11] = c;
+ caa[3][12] = ca[3] + caa[3][12];
+ }
+
#pragma acc data pcopy(ca[5:7])
{
c = 15;
ca[10] = c;
caa[3][12] = ca[3] + caa[3][12];
}
+
+#pragma acc serial pcopyout(caa[3:7][0:30])
+ {
+ c = 19;
+ ca[12] = c;
+ caa[3][12] = ca[3] + caa[3][12];
+ }
}
}
}
extern int i;
-/* While the OpenACC specification does allow for certain kinds of
- nesting, we don't support many of these yet. */
+/* The OpenACC specification allows nested compute constructs, but we don't
+ support that yet. */
+
void
f_acc_parallel (void)
{
;
#pragma acc kernels /* { dg-bogus ".kernels. construct inside of .parallel. region" "not implemented" { xfail *-*-* } } */
;
+#pragma acc serial /* { dg-bogus ".serial. construct inside of .parallel. region" "not implemented" { xfail *-*-* } } */
+ ;
#pragma acc data /* { dg-error ".data. construct inside of .parallel. region" } */
;
#pragma acc update host(i) /* { dg-error ".update. construct inside of .parallel. region" } */
}
}
-/* While the OpenACC specification does allow for certain kinds of
- nesting, we don't support many of these yet. */
void
f_acc_kernels (void)
{
;
#pragma acc kernels /* { dg-bogus ".kernels. construct inside of .kernels. region" "not implemented" { xfail *-*-* } } */
;
+#pragma acc serial /* { dg-bogus ".serial. construct inside of .kernels. region" "not implemented" { xfail *-*-* } } */
+ ;
#pragma acc data /* { dg-error ".data. construct inside of .kernels. region" } */
;
#pragma acc update host(i) /* { dg-error ".update. construct inside of .kernels. region" } */
}
}
+void
+f_acc_serial (void)
+{
+#pragma acc serial
+ {
+#pragma acc parallel /* { dg-bogus ".parallel. construct inside of .serial. region" "not implemented" { xfail *-*-* } } */
+ ;
+#pragma acc kernels /* { dg-bogus ".kernels. construct inside of .serial. region" "not implemented" { xfail *-*-* } } */
+ ;
+#pragma acc serial /* { dg-bogus ".serial. construct inside of .serial. region" "not implemented" { xfail *-*-* } } */
+ ;
+#pragma acc data /* { dg-error ".data. construct inside of .serial. region" } */
+ ;
+#pragma acc update host(i) /* { dg-error ".update. construct inside of .serial. region" } */
+#pragma acc enter data copyin(i) /* { dg-error ".enter data. construct inside of .serial. region" } */
+#pragma acc exit data delete(i) /* { dg-error ".exit data. construct inside of .serial. region" } */
+ }
+}
+
void
f_acc_data (void)
{
+// See also 'kernels-1.c', 'serial-1.c'.
+
int
parallel_empty (void)
{
for (i = 0; i < 100; i++)
r += 10;
+ #pragma acc serial
+ #pragma acc loop private (r) reduction (+:r)
+ /* { dg-note {variable 'r' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} r { target *-*-* } .-1 } */
+ /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} i { target *-*-* } .-2 } */
+ for (i = 0; i < 100; i++)
+ r += 10;
+
return r;
}
#pragma acc parallel reduction(+:v1,v2) pcreate(v1,v2) /* { dg-warning "incompatible data clause with reduction" } */
;
+
+#pragma acc serial reduction(+:v1,v2)
+ ;
+#pragma acc serial reduction(+:v1,v2) copy(v1,v2)
+ ;
+#pragma acc serial reduction(+:v1,v2) pcopy(v1,v2)
+ ;
+#pragma acc serial reduction(+:v1,v2) present(v1,v2)
+ ;
+#pragma acc serial reduction(+:v1,v2) copyin(v1,v2) /* { dg-warning "incompatible data clause with reduction" } */
+ ;
+#pragma acc serial reduction(+:v1,v2) pcopyin(v1,v2) /* { dg-warning "incompatible data clause with reduction" } */
+ ;
+#pragma acc serial reduction(+:v1,v2) copyout(v1,v2) /* { dg-warning "incompatible data clause with reduction" } */
+ ;
+#pragma acc serial reduction(+:v1,v2) pcopyout(v1,v2) /* { dg-warning "incompatible data clause with reduction" } */
+ ;
+#pragma acc serial reduction(+:v1,v2) create(v1,v2) /* { dg-warning "incompatible data clause with reduction" } */
+ ;
+#pragma acc serial reduction(+:v1,v2) pcreate(v1,v2) /* { dg-warning "incompatible data clause with reduction" } */
+ ;
+
+
return 0;
}
+/* Ensure that routines with a certain level of parallelism can be called. */
+
/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
aspects of that functionality. */
seq ();
}
+#pragma acc serial
+ /* { dg-warning "region contains gang partitioned code but is not gang partitioned" "" { target *-*-* } .-1 }
+ { dg-warning "region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 }
+ { dg-warning "region contains vector partitioned code but is not vector partitioned" "" { target *-*-* } .-3 } */
+ {
+ gang ();
+ worker ();
+ vector ();
+ seq ();
+ }
+
return 0;
}
goto bad1; // { dg-error "invalid branch to/from OpenACC structured block" }
#pragma acc kernels
goto bad1; // { dg-error "invalid branch to/from OpenACC structured block" }
+ #pragma acc serial
+ goto bad1; // { dg-error "invalid branch to/from OpenACC structured block" }
#pragma acc data
goto bad1; // { dg-error "invalid branch to/from OpenACC structured block" }
#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
bad2_kernels: ;
}
+ goto bad2_serial; // { dg-error "invalid entry to OpenACC structured block" }
+ #pragma acc serial
+ {
+ bad2_serial: ;
+ }
+
goto bad2_data; // { dg-error "invalid entry to OpenACC structured block" }
#pragma acc data
{
{ ok1_kernels: break; }
}
+ #pragma acc serial
+ {
+ int i;
+ goto ok1_serial;
+ for (i = 0; i < 10; ++i)
+ { ok1_serial: break; }
+ }
+
#pragma acc data
{
int i;
{ case 0:; }
}
+ switch (i) // { dg-error "invalid entry to OpenACC structured block" }
+ {
+ #pragma acc serial // { dg-warning "statement will never be executed" }
+ { case 0:; }
+ }
+
switch (i) // { dg-error "invalid entry to OpenACC structured block" }
{
#pragma acc data // { dg-warning "statement will never be executed" }
--- /dev/null
+// See also 'kernels-1.c', 'parallel-1.c'.
+
+int
+serial_empty (void)
+{
+#pragma acc serial
+ ;
+
+ return 0;
+}
+
+int
+serial_eternal (void)
+{
+#pragma acc serial
+ {
+ while (1)
+ ;
+ }
+
+ return 0;
+}
+
+int
+serial_noreturn (void)
+{
+#pragma acc serial
+ __builtin_abort ();
+
+ return 0;
+}
+
+int
+serial_clauses (void)
+{
+ int a, b[100];
+
+#pragma acc serial firstprivate (a, b)
+ ;
+
+ return 0;
+}
/* { dg-additional-options "-Wuninitialized" } */
void
-foo (void)
+foo_parallel (void)
{
int i;
}
}
+void
+foo_serial (void)
+{
+ int i;
+
+#pragma acc serial
+ {
+ i = 1;
+ }
+}
+
void
-foo2 (void)
+foo2_parallel (void)
{
int i;
/* { dg-note {'i' was declared here} {} { target *-*-* } .-1 } */
i = 1;
}
}
+
+void
+foo2_serial (void)
+{
+ int i;
+ /* { dg-note {'i' was declared here} {} { target *-*-* } .-1 } */
+
+#pragma acc serial firstprivate (i) /* { dg-warning "is used uninitialized" } */
+ {
+ i = 1;
+ }
+}
int
main (void)
{
- int l, l2, l3, l4;
+ int l, l2, ls, l3, l4;
/* { dg-note {'l' was declared here} {} { target *-*-* } .-1 } */
/* { dg-note {'l2' was declared here} {} { target *-*-* } .-2 } */
- /* { dg-note {'l3' was declared here} {} { target *-*-* } .-3 } */
- /* { dg-note {'l4' was declared here} {} { target *-*-* } .-4 } */
- bool b, b2, b3, b4;
+ /* { dg-note {'ls' was declared here} {} { target *-*-* } .-3 } */
+ /* { dg-note {'l3' was declared here} {} { target *-*-* } .-4 } */
+ /* { dg-note {'l4' was declared here} {} { target *-*-* } .-5 } */
+ bool b, b2, bs, b3, b4;
/* { dg-note {'b' was declared here} {} { target *-*-* } .-1 } */
/* { dg-note {'b2' was declared here} {} { target *-*-* } .-2 } */
- /* { dg-note {'b3' was declared here} {} { target *-*-* } .-3 } */
- /* { dg-note {'b4' was declared here} {} { target *-*-* } .-4 } */
+ /* { dg-note {'bs' was declared here} {} { target *-*-* } .-3 } */
+ /* { dg-note {'b3' was declared here} {} { target *-*-* } .-4 } */
+ /* { dg-note {'b4' was declared here} {} { target *-*-* } .-5 } */
int i, i2;
#pragma acc parallel if(l) /* { dg-warning "is used uninitialized" } */
#pragma acc kernels if(b2) /* { dg-warning "is used uninitialized" } */
;
+ #pragma acc serial if(ls) /* { dg-warning "is used uninitialized" } */
+ ;
+
+ #pragma acc serial if(bs) /* { dg-warning "is used uninitialized" } */
+ ;
+
#pragma acc data if(l3) /* { dg-warning "is used uninitialized" } */
;
#pragma acc parallel loop if_present /* { dg-error "'if_present' is not valid" } */
for (b = 1; b < 10; b++)
;
+
+#pragma acc serial loop if_present /* { dg-error "'if_present' is not valid" } */
+ for (b = 1; b < 10; b++)
+ ;
}
return b;
}
+template<typename T, int I> T
+oacc_serial_copy (T a)
+{
+ T b = 0;
+ char w = 1;
+ int x = 2;
+ float y = 3;
+ double z = 4;
+
+#pragma acc serial default (none) copyout (b) copyin (a)
+#pragma acc loop gang worker vector
+ for (int i = 0; i < 1; i++)
+ b = a;
+
+#pragma acc serial copy (w, x, y, z)
+#pragma acc loop
+ for (int i = 0; i < 1; i++)
+ {
+ w = accDouble<char>(w);
+ x = accDouble<int>(x);
+ y = accDouble<float>(y);
+ z = accDouble<double>(z);
+ }
+
+#pragma acc serial if (1)
+ {
+#pragma acc loop independent collapse (2)
+ for (int i = 0; i < a; i++)
+ for (int j = 0; j < 5; j++)
+ b = a;
+
+#pragma acc loop auto tile (I, 3)
+ for (int i = 0; i < a; i++)
+ for (int j = 0; j < 5; j++)
+ b = a;
+
+#pragma acc loop seq
+ for (int i = 0; i < a; i++)
+ b = a;
+ }
+
+ T c;
+
+#pragma acc serial
+#pragma acc loop worker
+ for (int i = 0; i < 1; i++)
+ {
+#pragma acc atomic capture
+ c = b++;
+
+#pragma atomic update
+ c++;
+
+#pragma acc atomic read
+ b = a;
+
+#pragma acc atomic write
+ b = a;
+ }
+
+#pragma acc serial reduction (+:c)
+ c = 1;
+
+#pragma acc data if (1) copy (b)
+ {
+#pragma acc serial
+ {
+ b = a;
+ }
+ }
+
+#pragma acc enter data copyin (b)
+#pragma acc serial present (b)
+ {
+ b = a;
+ }
+
+#pragma acc update host (b)
+#pragma acc update self (b)
+#pragma acc update device (b)
+#pragma acc exit data delete (b)
+#pragma acc exit data finalize copyout (b)
+#pragma acc exit data delete (b) finalize
+
+ return b;
+}
+
int
main ()
{
int b = oacc_parallel_copy<int, 4> (5);
int c = oacc_kernels_copy<int> (5);
+ int d = oacc_serial_copy<int, 6> (5);
- return b + c;
+ return b + c + d;
}
/* { dg-final { scan-tree-dump-times {(?n)^OpenACC routine '[^']+' has 'nohost' clause\.$} 4 oaccloops } }
end do
!$acc end kernels
+ !$acc serial reduction (+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
+ do i = 1, 10
+ a = a + 1
+ end do
+ !$acc end serial
+
+ !$acc serial
+ !$acc loop reduction (+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
+ do i = 1, 10
+ a = a + 1
+ end do
+ !$acc end serial
+
+
! Subarray reductions.
!$acc parallel reduction (+:a(1:5)) ! { dg-error "Array 'a' is not permitted in reduction" }
end do
!$acc end kernels
+ !$acc serial reduction (+:a(1:5)) ! { dg-error "Array 'a' is not permitted in reduction" }
+ do i = 1, 10
+ a = a + 1
+ end do
+ !$acc end serial
+
+ !$acc serial
+ !$acc loop reduction (+:a(1:5)) ! { dg-error "Array 'a' is not permitted in reduction" }
+ do i = 1, 10
+ a = a + 1
+ end do
+ !$acc end serial
+
+
! Reductions on array elements.
!$acc parallel reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
end do
!$acc end kernels
+ !$acc serial reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
+ do i = 1, 10
+ a(1) = a(1) + 1
+ end do
+ !$acc end serial
+
+ !$acc serial
+ !$acc loop reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
+ do i = 1, 10
+ a(1) = a(1) + 1
+ end do
+ !$acc end serial
+
+
print *, a
end program test
!$acc end data
!$acc parallel private (a) ! { dg-error "Assumed size" }
!$acc end parallel
+ !$acc serial private (a) ! { dg-error "Assumed size" }
+ !$acc end serial
!$acc host_data use_device (a) ! { dg-error "Assumed size" }
!$acc end host_data
!$acc parallel loop reduction(+:a) ! { dg-error "Assumed size" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:a) ! { dg-error "Assumed size" }
+ ! { dg-error "Array 'a' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc update device (a) ! { dg-error "Assumed size" }
!$acc update host (a) ! { dg-error "Assumed size" }
!$acc update self (a) ! { dg-error "Assumed size" }
!$acc end data
!$acc parallel private (a) ! { dg-error "Assumed rank" }
!$acc end parallel
+ !$acc serial private (a) ! { dg-error "Assumed rank" }
+ !$acc end serial
!$acc host_data use_device (a) ! { dg-error "Assumed rank" }
!$acc end host_data
!$acc parallel loop reduction(+:a) ! { dg-error "Assumed rank" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:a) ! { dg-error "Assumed rank" }
+ ! { dg-error "Array 'a' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc update device (a) ! { dg-error "Assumed rank" }
!$acc update host (a) ! { dg-error "Assumed rank" }
!$acc update self (a) ! { dg-error "Assumed rank" }
!$acc end kernels
end if
+ if (.true.) then
+ !$acc serial
+ end if ! { dg-error "Unexpected" }
+ !$acc end serial
+ end if
+
!$acc parallel
if (.true.) then
!$acc end parallel ! { dg-error "Unexpected" }
end if
!$acc end kernels
+ !$acc serial
+ if (.true.) then
+ !$acc end serial ! { dg-error "Unexpected" }
+ end if
+ !$acc end serial
+
!$acc parallel
if (.true.) then
end if
end if
!$acc end kernels
+ !$acc serial
+ if (.true.) then
+ end if
+ !$acc end serial
+
if (.true.) then
!$acc parallel
!$acc end parallel
!$acc end kernels
end if
+ if (.true.) then
+ !$acc serial
+ !$acc end serial
+ end if
end program test
\ No newline at end of file
!$acc end data
!$acc parallel private (a)
!$acc end parallel
+ !$acc serial private (a)
+ !$acc end serial
!$acc host_data use_device (a)
!$acc end host_data
!$acc parallel loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc parallel loop
do i = 1,5
!$acc cache (a) ! { dg-error "" "TODO" { xfail *-*-* } }
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ !$acc cache (a) ! { dg-error "" "TODO" { xfail *-*-* } }
+ enddo
+ !$acc end serial loop
!$acc update device (a)
!$acc update host (a)
!$acc update self (a)
!$acc end data
!$acc parallel private (a)
!$acc end parallel
+ !$acc serial private (a)
+ !$acc end serial
!$acc host_data use_device (a)
!$acc end host_data
!$acc parallel loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc parallel loop
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc update device (a)
!$acc update host (a)
!$acc update self (a)
!$acc end data
!$acc parallel private (a)
!$acc end parallel
+ !$acc serial private (a)
+ !$acc end serial
! FIXME:
! !$acc parallel loop reduction(+:a)
! This involves an assignment, which shall not reallocate
do i = 1,5
enddo
!$acc end parallel loop
+! FIXME:
+! !$acc serial loop reduction(+:a)
+! This involves an assignment, which shall not reallocate
+! the LHS variable. Version without reduction:
+ !$acc serial loop
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc parallel loop
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc update device (a)
!$acc update host (a)
!$acc update self (a)
!$acc end data
!$acc parallel private (a)
!$acc end parallel
+ !$acc serial private (a)
+ !$acc end serial
!$acc host_data use_device (a)
!$acc end host_data
!$acc parallel loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc parallel loop
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc update device (a)
!$acc update host (a)
!$acc update self (a)
!$acc end data
!$acc parallel private (a)
!$acc end parallel
+ !$acc serial private (a)
+ !$acc end serial
!$acc parallel loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc parallel loop
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc update device (a)
!$acc update host (a)
!$acc update self (a)
end do
end do
!$acc end parallel loop
+
+
+ !$acc serial loop seq auto ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
+ do x = 0, 10
+ !$acc loop
+ do y = 0, 10
+ end do
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop gang auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
+ do x = 0, 10
+ !$acc loop worker auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
+ do y = 0, 10
+ !$acc loop vector
+ do z = 0, 10
+ end do
+ end do
+ end do
+ !$acc end serial loop
+
end subroutine test
implicit none
integer a(100), i, j, y, z
+
! PARALLEL
!$acc parallel loop collapse (2)
end do
!$acc end parallel loop
+
! KERNELS
!$acc kernels loop collapse (2)
do i = 1, 100
end do
!$acc end kernels loop
+
+
+ ! SERIAL
+
+ !$acc serial loop collapse (2)
+ do i = 1, 100
+ do j = 1, 10
+ end do
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop gang
+ do i = 1, 100
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop worker
+ do i = 1, 100
+ do j = 1, 10
+ end do
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop vector
+ do i = 1, 100
+ do j = 1, 10
+ end do
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop seq
+ do i = 1, 100
+ do j = 1, 10
+ end do
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop auto
+ do i = 1, 100
+ do j = 1, 10
+ end do
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop tile (2, 3)
+ do i = 1, 100
+ do j = 1, 10
+ end do
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop independent
+ do i = 1, 100
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop private (z)
+ do i = 1, 100
+ z = 0
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop reduction (+:y) copy (y)
+ do i = 1, 100
+ end do
+ !$acc end serial loop
+
end subroutine test
-! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. collapse.2." 2 "gimple" } }
-! { dg-final { scan-tree-dump-times "acc loop private.i. gang" 2 "gimple" } }
-! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. worker" 2 "gimple" } }
-! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. vector" 2 "gimple" } }
-! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. seq" 2 "gimple" } }
-! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. auto" 2 "gimple" } }
-! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. tile.2, 3" 2 "gimple" } }
-! { dg-final { scan-tree-dump-times "acc loop private.i. independent" 2 "gimple" } }
-! { dg-final { scan-tree-dump-times "private.z" 2 "gimple" } }
-! { dg-final { scan-tree-dump-times "omp target oacc_\[^ \]+ map.tofrom:y" 2 "gimple" } }
-! { dg-final { scan-tree-dump-times "acc loop private.i. reduction..:y." 2 "gimple" } }
+
+! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. collapse.2." 3 "gimple" } }
+! { dg-final { scan-tree-dump-times "acc loop private.i. gang" 3 "gimple" } }
+! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. worker" 3 "gimple" } }
+! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. vector" 3 "gimple" } }
+! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. seq" 3 "gimple" } }
+! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. auto" 3 "gimple" } }
+! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. tile.2, 3" 3 "gimple" } }
+! { dg-final { scan-tree-dump-times "acc loop private.i. independent" 3 "gimple" } }
+! { dg-final { scan-tree-dump-times "private.z" 3 "gimple" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_\[^ \]+ map.tofrom:y" 3 "gimple" } }
+! { dg-final { scan-tree-dump-times "acc loop private.i. reduction..:y." 3 "gimple" } }
!$acc parallel firstprivate(/blockA/, /blockB/, e, v)
!$acc end parallel
+ !$acc serial private(/blockA/, /blockB/, e, v)
+ !$acc end serial
+
+ !$acc serial firstprivate(/blockA/, /blockB/, e, v)
+ !$acc end serial
+
!$acc update device(/blockA/)
!$acc update self(/blockB/, v)
!$acc update host(/blockA/, e, /blockB/)
!$acc parallel firstprivate(/blockA/, /blockB/, e, v, a) ! { dg-error "Symbol .a. present on multiple clauses" }
!$acc end parallel
+ !$acc serial private(/blockA/, /blockB/, e, v, a) ! { dg-error "Symbol .a. present on multiple clauses" }
+ !$acc end serial
+
+ !$acc serial firstprivate(/blockA/, /blockB/, e, v, a) ! { dg-error "Symbol .a. present on multiple clauses" }
+ !$acc end serial
+
!$acc update device(b, /blockA/, x) ! { dg-error "Symbol .x. present on multiple clauses" }
!$acc update self(z, /blockB/, v) ! { dg-error "Symbol .z. present on multiple clauses" }
!$acc update host(/blockA/, c) ! { dg-error "Symbol .c. present on multiple clauses" }
x(i) = y(i) + c
end do
!$acc end kernels
+ !$acc serial loop copy(/BLOCK/) ! { dg-line l3 }
+ ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l3 }
+ ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l3 }
+ do i = 1, n
+ a(i) = b(i) + c
+ end do
end program main
! { dg-final { scan-tree-dump-times "omp target oacc_parallel .*map\\(tofrom:a \\\[len: 400\\\]\\)" 1 "omplower" } }
! { dg-final { scan-tree-dump-times "omp target oacc_data_kernels .*map\\(force_tofrom:c \\\[len: 4\\\]\\)" 1 "omplower" } }
! { dg-final { scan-tree-dump-times "omp target oacc_kernels .*map\\(force_present:c \\\[len: 4\\\]\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_serial .*map\\(tofrom:a \\\[len: 400\\\]\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_serial .*map\\(tofrom:b \\\[len: 400\\\]\\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_serial .*map\\(tofrom:c \\\[len: 4\\\]\\)" 1 "omplower" } }
+
! Expecting no mapping of un-referenced common-blocks variables
! { dg-final { scan-tree-dump-not "map\\(.*:block" "omplower" } }
! { dg-do compile }
! { dg-additional-options "-fmax-errors=100" }
-! test clauses added in OpenACC ver 2.0
-
program test
implicit none
integer :: i, a(10), b(5:7)
!$acc end kernels
!$acc parallel async(i)
!$acc end parallel
+ !$acc serial async(i)
+ !$acc end serial
!$acc kernels async(0, 1) { dg-error "Failed to match clause" }
!$acc parallel async(0, 1) { dg-error "Failed to match clause" }
+ !$acc serial async(0, 1) { dg-error "Failed to match clause" }
!$acc kernels async
!$acc end kernels
!$acc parallel async
!$acc end parallel
+ !$acc serial async
+ !$acc end serial
!$acc kernels async(acc_async_noval)
!$acc end kernels
!$acc parallel async(acc_async_noval)
!$acc end parallel
+ !$acc serial async(acc_async_noval)
+ !$acc end serial
!$acc kernels async(acc_async_sync)
!$acc end kernels
!$acc parallel async(acc_async_sync)
!$acc end parallel
+ !$acc serial async(acc_async_sync)
+ !$acc end serial
!$acc kernels async() { dg-error "Invalid character" }
!$acc parallel async() { dg-error "Invalid character" }
+ !$acc serial async() { dg-error "Invalid character" }
!$acc kernels async("a") { dg-error "Failed to match clause" }
!$acc parallel async("a") { dg-error "Failed to match clause" }
+ !$acc serial async("a") { dg-error "Failed to match clause" }
!$acc kernels async(.true.) { dg-error "Failed to match clause" }
!$acc parallel async(.true.) { dg-error "Failed to match clause" }
+ !$acc serial async(.true.) { dg-error "Failed to match clause" }
! default(none)
!$acc kernels default(none)
!$acc end kernels
!$acc parallel default(none)
!$acc end parallel
+ !$acc serial default(none)
+ !$acc end serial
!$acc kernels default (none)
!$acc end kernels
!$acc parallel default (none)
!$acc end parallel
+ !$acc serial default (none)
+ !$acc end serial
!$acc kernels default ( none )
!$acc end kernels
!$acc parallel default ( none )
!$acc end parallel
+ !$acc serial default ( none )
+ !$acc end serial
!$acc kernels default { dg-error "Expected '\\(' after 'default'" }
!$acc parallel default { dg-error "Expected '\\(' after 'default'" }
+ !$acc serial default { dg-error "Expected '\\(' after 'default'" }
!$acc kernels default() { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$acc parallel default() { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
+ !$acc serial default() { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$acc kernels default(i) { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$acc parallel default(i) { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
+ !$acc serial default(i) { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$acc kernels default(1) { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$acc parallel default(1) { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
+ !$acc serial default(1) { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
! Wait
!$acc kernels wait (l) ! { dg-error "INTEGER" }
!$acc end parallel
!$acc parallel wait (b(5:6)) ! { dg-error "INTEGER" }
!$acc end parallel
+
+ !$acc serial wait (l) ! { dg-error "INTEGER" }
+ !$acc end serial
+ !$acc serial wait (.true.) ! { dg-error "INTEGER" }
+ !$acc end serial
+ !$acc serial wait (i, 1)
+ !$acc end serial
+ !$acc serial wait (a) ! { dg-error "INTEGER" }
+ !$acc end serial
+ !$acc serial wait (b(5:6)) ! { dg-error "INTEGER" }
+ !$acc end serial
+
end
!$acc end data
!$acc parallel private (pointee) ! { dg-error "Cray pointee" }
!$acc end parallel
+ !$acc serial private (pointee) ! { dg-error "Cray pointee" }
+ !$acc end serial
!$acc host_data use_device (pointee) ! { dg-error "Cray pointee" }
!$acc end host_data
!$acc parallel loop reduction(+:pointee) ! { dg-error "Cray pointee" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:pointee) ! { dg-error "Cray pointee" }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc parallel loop
do i = 1,5
!$acc cache (pointee) ! { dg-error "Cray pointee" }
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ !$acc cache (pointee) ! { dg-error "Cray pointee" }
+ enddo
+ !$acc end serial loop
!$acc update device (pointee) ! { dg-error "Cray pointee" }
!$acc update host (pointee) ! { dg-error "Cray pointee" }
!$acc update self (pointee) ! { dg-error "Cray pointee" }
!$acc end data
!$acc parallel private (ptr)
!$acc end parallel
+ !$acc serial private (ptr)
+ !$acc end serial
!$acc host_data use_device (ptr) ! { dg-error "Cray pointer" }
!$acc end host_data
!$acc parallel loop reduction(+:ptr) ! { dg-error "Cray pointer" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:ptr) ! { dg-error "Cray pointer" }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc parallel loop
do i = 1,5
!TODO: This must fail, as in openacc-1_0-branch.
!$acc cache (ptr) ! { dg-error "" "TODO" { xfail *-*-* } }
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ !TODO: This must fail, as in openacc-1_0-branch.
+ !$acc cache (ptr) ! { dg-error "" "TODO" { xfail *-*-* } }
+ enddo
+ !$acc end serial loop
!$acc update device (ptr)
!$acc update host (ptr)
!$acc update self (ptr)
!$acc end data
!$acc parallel private (pointee) ! { dg-error "Cray pointee" }
!$acc end parallel
+ !$acc serial private (pointee) ! { dg-error "Cray pointee" }
+ !$acc end serial
!$acc host_data use_device (pointee) ! { dg-error "Cray pointee" }
!$acc end host_data
!$acc parallel loop reduction(+:pointee) ! { dg-error "Cray pointee" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:pointee) ! { dg-error "Cray pointee" }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc parallel loop
do i = 1,5
!$acc cache (pointee) ! { dg-error "Cray pointee" }
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ !$acc cache (pointee) ! { dg-error "Cray pointee" }
+ enddo
+ !$acc end serial loop
!$acc update device (pointee) ! { dg-error "Cray pointee" }
!$acc update host (pointee) ! { dg-error "Cray pointee" }
!$acc update self (pointee) ! { dg-error "Cray pointee" }
!$acc end data
!$acc parallel private (ptr)
!$acc end parallel
+ !$acc serial private (ptr)
+ !$acc end serial
!$acc host_data use_device (ptr) ! { dg-error "Cray pointer" }
!$acc end host_data
!$acc parallel loop reduction(+:ptr) ! { dg-error "Cray pointer" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:ptr) ! { dg-error "Cray pointer" }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc parallel loop
do i = 1,5
!TODO: This must fail, as in openacc-1_0-branch.
!$acc cache (ptr) ! { dg-error "" "TODO" { xfail *-*-* } }
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ !TODO: This must fail, as in openacc-1_0-branch.
+ !$acc cache (ptr) ! { dg-error "" "TODO" { xfail *-*-* } }
+ enddo
+ !$acc end serial loop
!$acc update device (ptr)
!$acc update host (ptr)
!$acc update self (ptr)
j = j + 1
end critical
!$acc end parallel
+ !$acc serial
+ critical ! { dg-error "CRITICAL block inside of" }
+ j = j + 1
+ end critical
+ !$acc end serial
end subroutine oacc1
subroutine oacc2
!$acc parallel ! { dg-error "OpenACC directive inside of" }
j = j + 1
!$acc end parallel
+ !$acc serial ! { dg-error "OpenACC directive inside of" }
+ j = j + 1
+ !$acc end serial
end critical
end subroutine oacc2
end module test
\ No newline at end of file
!$acc end parallel
!$acc kernels deviceptr (i, c, r, ia, ca, ra, asa, ti)
!$acc end kernels
+ !$acc serial deviceptr (i, c, r, ia, ca, ra, asa, ti)
+ !$acc end serial
!$acc data deviceptr (i, c, r, ia, ca, ra, asa, ti)
!$acc end data
!$acc end parallel
!$acc kernels copy (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end kernels
+ !$acc serial copy (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
+ !$acc end serial
!$acc data copy (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end data
!$acc end parallel
!$acc kernels copyin (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end kernels
+ !$acc serial copyin (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
+ !$acc end serial
!$acc data copyin (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end data
!$acc end parallel
!$acc kernels copyout (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end kernels
+ !$acc serial copyout (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
+ !$acc end serial
!$acc data copyout (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end data
!$acc end parallel
!$acc kernels create (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end kernels
+ !$acc serial create (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
+ !$acc end serial
!$acc data create (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end data
!$acc end parallel
!$acc kernels no_create (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end kernels
+ !$acc serial no_create (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
+ !$acc end serial
!$acc data no_create (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end data
!$acc end parallel
!$acc kernels present (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end kernels
+ !$acc serial present (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
+ !$acc end serial
!$acc data present (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end data
!$acc end parallel
!$acc kernels present_or_copy (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end kernels
+ !$acc serial present_or_copy (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
+ !$acc end serial
!$acc data present_or_copy (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end data
!$acc end parallel
!$acc kernels present_or_copyin (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end kernels
+ !$acc serial present_or_copyin (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
+ !$acc end serial
!$acc data present_or_copyin (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end data
!$acc end parallel
!$acc kernels present_or_copyout (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end kernels
+ !$acc serial present_or_copyout (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
+ !$acc end serial
!$acc data present_or_copyout (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end data
!$acc end parallel
!$acc kernels present_or_create (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end kernels
+ !$acc serial present_or_create (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
+ !$acc end serial
!$acc data present_or_create (i, c, r, ia, ca, ra, asa, rp, ti, vi, aa)
!$acc end data
!$acc end kernels
!$acc parallel default (none)
!$acc end parallel
+ !$acc serial default (none)
+ !$acc end serial
!$acc kernels default (present)
!$acc end kernels
!$acc parallel default (present)
!$acc end parallel
+ !$acc serial default (present)
+ !$acc end serial
+
end subroutine f1
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT ! { dg-error "Expected '\\(' after 'default" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT ! { dg-error "Expected '\\(' after 'default" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
!$ACC KERNELS DEFAULT ( ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT ( ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT ( ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
!$ACC KERNELS DEFAULT (, ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT (, ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT (, ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
!$ACC KERNELS DEFAULT () ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT () ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT () ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
!$ACC KERNELS DEFAULT (,) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT (,) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT (,) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
!$ACC KERNELS DEFAULT (FIRSTPRIVATE) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT (FIRSTPRIVATE) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT (FIRSTPRIVATE) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
!$ACC KERNELS DEFAULT (PRIVATE) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT (PRIVATE) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT (PRIVATE) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
!$ACC KERNELS DEFAULT (SHARED) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT (SHARED) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT (SHARED) ! { dg-error "Expected NONE or PRESENT in DEFAULT clause" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
!$ACC KERNELS DEFAULT (NONE ! { dg-error "Failed to match clause" }
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT (NONE ! { dg-error "Failed to match clause" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT (NONE ! { dg-error "Failed to match clause" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
!$ACC KERNELS DEFAULT (NONE NONE) ! { dg-error "Failed to match clause" }
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT (NONE NONE) ! { dg-error "Failed to match clause" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT (NONE NONE) ! { dg-error "Failed to match clause" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
!$ACC KERNELS DEFAULT (NONE, NONE) ! { dg-error "Failed to match clause" }
!$ACC END KERNELS ! { dg-error "Unexpected" }
!$ACC PARALLEL DEFAULT (NONE, NONE) ! { dg-error "Failed to match clause" }
!$ACC END PARALLEL ! { dg-error "Unexpected" }
+!$ACC SERIAL DEFAULT (NONE, NONE) ! { dg-error "Failed to match clause" }
+!$ACC END SERIAL ! { dg-error "Unexpected" }
+
END SUBROUTINE F1
= f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .parallel. construct" }
! { dg-bogus ".f1_b. not specified in enclosing OpenACC .parallel. construct" "" { xfail *-*-* } .-1 }
!$acc end parallel
+ !$acc serial default (none) ! { dg-note "enclosing OpenACC .serial. construct with 'default\\\(none\\\)' clause" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } .-1 }
+ !$acc end serial
!$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
!$acc kernels ! { dg-note "enclosing OpenACC 'kernels' construct and" }
! { dg-bogus ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } .-1 }
!$acc end kernels
!$acc end data
-
!$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
!$acc parallel ! { dg-note "enclosing OpenACC 'parallel' construct and" }
f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .parallel. construct" "" { xfail *-*-* } }
! { dg-bogus ".f1_b. not specified in enclosing OpenACC .parallel. construct" "" { xfail *-*-* } .-1 }
!$acc end parallel
!$acc end data
+ !$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
+ !$acc serial ! { dg-note "enclosing OpenACC 'serial' construct and" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } .-1 }
+ !$acc end serial
+ !$acc end data
+ !$acc data default (none)
+ !$acc kernels default (none) ! { dg-note "enclosing OpenACC .kernels. construct with 'default\\\(none\\\)' clause" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .kernels. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } .-1 }
+ !$acc end kernels
+ !$acc end data
!$acc data default (none)
!$acc parallel default (none) ! { dg-note "enclosing OpenACC .parallel. construct with 'default\\\(none\\\)' clause" }
f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .parallel. construct" "" { xfail *-*-* } }
! { dg-bogus ".f1_b. not specified in enclosing OpenACC .parallel. construct" "" { xfail *-*-* } .-1 }
!$acc end parallel
!$acc end data
+ !$acc data default (none)
+ !$acc serial default (none) ! { dg-note "enclosing OpenACC .serial. construct with 'default\\\(none\\\)' clause" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } .-1 }
+ !$acc end serial
+ !$acc end data
+ !$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
+ !$acc data
+ !$acc data
+ !$acc kernels ! { dg-note "enclosing OpenACC 'kernels' construct and" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .kernels. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } .-1 }
+ !$acc end kernels
+ !$acc end data
+ !$acc end data
+ !$acc end data
!$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
!$acc data
!$acc data
!$acc end data
!$acc end data
!$acc end data
+ !$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
+ !$acc data
+ !$acc data
+ !$acc serial ! { dg-note "enclosing OpenACC 'serial' construct and" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } .-1 }
+ !$acc end serial
+ !$acc end data
+ !$acc end data
+ !$acc end data
+ !$acc data
+ !$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
+ !$acc data
+ !$acc kernels ! { dg-note "enclosing OpenACC 'kernels' construct and" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .kernels. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } .-1 }
+ !$acc end kernels
+ !$acc end data
+ !$acc end data
+ !$acc end data
!$acc data
!$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
!$acc data
!$acc end data
!$acc end data
!$acc end data
+ !$acc data
+ !$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
+ !$acc data
+ !$acc serial ! { dg-note "enclosing OpenACC 'serial' construct and" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } .-1 }
+ !$acc end serial
+ !$acc end data
+ !$acc end data
+ !$acc end data
+ !$acc data
+ !$acc data
+ !$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
+ !$acc kernels ! { dg-note "enclosing OpenACC 'kernels' construct and" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .kernels. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } .-1 }
+ !$acc end kernels
+ !$acc end data
+ !$acc end data
+ !$acc end data
!$acc data
!$acc data
!$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
!$acc end data
!$acc end data
!$acc end data
+ !$acc data
+ !$acc data
+ !$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
+ !$acc serial ! { dg-note "enclosing OpenACC 'serial' construct and" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } .-1 }
+ !$acc end serial
+ !$acc end data
+ !$acc end data
+ !$acc end data
+ !$acc data
+ !$acc data default (none)
+ !$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
+ !$acc kernels ! { dg-note "enclosing OpenACC 'kernels' construct and" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .kernels. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .kernels. construct" "" { xfail *-*-* } .-1 }
+ !$acc end kernels
+ !$acc end data
+ !$acc end data
+ !$acc end data
!$acc data
!$acc data default (none)
!$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
!$acc end data
!$acc end data
!$acc end data
+ !$acc data
+ !$acc data default (none)
+ !$acc data default (none) ! { dg-note "enclosing OpenACC 'data' construct with 'default\\\(none\\\)' clause" }
+ !$acc serial ! { dg-note "enclosing OpenACC 'serial' construct and" }
+ f1_b(1) & ! { dg-error ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } }
+ = f1_a; ! { dg-error ".f1_a. not specified in enclosing OpenACC .serial. construct" }
+ ! { dg-bogus ".f1_b. not specified in enclosing OpenACC .serial. construct" "" { xfail *-*-* } .-1 }
+ !$acc end serial
+ !$acc end data
+ !$acc end data
+ !$acc end data
end subroutine f1
! { dg-final { scan-tree-dump-times "omp target oacc_parallel map\\(tofrom:f1_b \[^\\)\]+\\) map\\(tofrom:f1_a" 1 "gimple" } }
F1_B(1) = F1_A;
!$ACC END PARALLEL
+!$ACC SERIAL
+! { dg-final { scan-tree-dump-times "omp target oacc_serial map\\(tofrom:f1_b \[^\\)\]+\\) map\\(tofrom:f1_a" 1 "gimple" } }
+ F1_B(1) = F1_A;
+!$ACC END SERIAL
!$ACC END DATA
END SUBROUTINE F1
! { dg-final { scan-tree-dump-times "omp target oacc_parallel default\\(none\\) map\\(tofrom:f2_b \[^\\)\]+\\) map\\(tofrom:f2_a" 1 "gimple" } }
F2_B(1) = F2_A;
!$ACC END PARALLEL
+!$ACC SERIAL DEFAULT (NONE)
+! { dg-final { scan-tree-dump-times "omp target oacc_serial default\\(none\\) map\\(tofrom:f2_b \[^\\)\]+\\) map\\(tofrom:f2_a" 1 "gimple" } }
+ F2_B(1) = F2_A;
+!$ACC END SERIAL
!$ACC END DATA
END SUBROUTINE F2
! { dg-final { scan-tree-dump-times "omp target oacc_parallel map\\(tofrom:f2__b \[^\\)\]+\\) map\\(tofrom:f2__a" 1 "gimple" } }
F2__B(1) = F2__A;
!$ACC END PARALLEL
+!$ACC SERIAL
+! { dg-final { scan-tree-dump-times "omp target oacc_serial map\\(tofrom:f2__b \[^\\)\]+\\) map\\(tofrom:f2__a" 1 "gimple" } }
+ F2__B(1) = F2__A;
+!$ACC END SERIAL
!$ACC END DATA
END SUBROUTINE F2_
! { dg-final { scan-tree-dump-times "omp target oacc_parallel default\\(present\\) map\\(tofrom:f3_b \[^\\)\]+\\) map\\(tofrom:f3_a" 1 "gimple" } }
F3_B(1) = F3_A;
!$ACC END PARALLEL
+!$ACC SERIAL DEFAULT (PRESENT)
+! { dg-final { scan-tree-dump-times "omp target oacc_serial default\\(present\\) map\\(tofrom:f3_b \[^\\)\]+\\) map\\(tofrom:f3_a" 1 "gimple" } }
+ F3_B(1) = F3_A;
+!$ACC END SERIAL
!$ACC END DATA
END SUBROUTINE F3
! { dg-final { scan-tree-dump-times "omp target oacc_parallel map\\(tofrom:f3__b \[^\\)\]+\\) map\\(tofrom:f3__a" 1 "gimple" } }
F3__B(1) = F3__A;
!$ACC END PARALLEL
+!$ACC SERIAL
+! { dg-final { scan-tree-dump-times "omp target oacc_serial map\\(tofrom:f3__b \[^\\)\]+\\) map\\(tofrom:f3__a" 1 "gimple" } }
+ F3__B(1) = F3__A;
+!$ACC END SERIAL
!$ACC END DATA
END SUBROUTINE F3_
! { dg-final { scan-tree-dump-times "omp target oacc_parallel default\\(present\\) map\\(force_present:f1_b \[^\\)\]+\\) firstprivate\\(f1_a\\)" 1 "gimple" } }
F1_B(1) = F1_A;
!$ACC END PARALLEL
+!$ACC SERIAL DEFAULT (PRESENT)
+! { dg-final { scan-tree-dump-times "omp target oacc_serial default\\(present\\) map\\(force_present:f1_b \[^\\)\]+\\) firstprivate\\(f1_a\\)" 1 "gimple" } }
+ F1_B(1) = F1_A;
+!$ACC END SERIAL
!$ACC DATA DEFAULT (PRESENT)
!$ACC KERNELS
F1_D(1) = F1_C;
!$ACC END PARALLEL
!$ACC END DATA
+!$ACC END DATA
+!$ACC DATA DEFAULT (NONE)
+!$ACC DATA DEFAULT (NONE)
+!$ACC DATA DEFAULT (PRESENT)
+!$ACC SERIAL DEFAULT (PRESENT)
+! { dg-final { scan-tree-dump-times "omp target oacc_serial default\\(present\\) map\\(force_present:f1_d \[^\\)\]+\\) firstprivate\\(f1_c\\)" 1 "gimple" } }
+ F1_D(1) = F1_C;
+!$ACC END SERIAL
+!$ACC END DATA
+!$ACC END DATA
!$ACC END DATA
END SUBROUTINE F1
!$acc parallel loop default(none) copy (a1(1:n))
do i = 1,n
- a1(i) = i
+ a1(i) = a1(i) + 1 * i
end do
!$acc end parallel loop
+ !$acc serial loop default(none) copy (a1(1:n))
+ do i = 1,n
+ a1(i) = a1(i) + 3 * i
+ end do
+ !$acc end serial loop
+
call foo (a1)
call bar (a1, n)
call foobar (a2,n)
!$acc parallel loop default(none) copy (da1(1:n))
do i = 1,n
- da1(i) = i*2
+ da1(i) = da1(i) + 1 * i * 2
end do
!$acc end parallel loop
+
+ !$acc serial loop default(none) copy (da1(1:n))
+ do i = 1,n
+ da1(i) = da1(i) + 3 * i * 2
+ end do
+ !$acc end serial loop
+
end subroutine foo
end program main
!$acc parallel loop default(none) copy (da2(1:n)) firstprivate(n)
do i = 1,n
- da2(i) = i*3
+ da2(i) = da2(i) + 1 * i * 3
end do
!$acc end parallel loop
+
+ !$acc serial loop default(none) copy (da2(1:n)) firstprivate(n)
+ do i = 1,n
+ da2(i) = da2(i) + 1 * i * 3
+ end do
+ !$acc end serial loop
+
end subroutine bar
subroutine foobar (da3,n)
!$acc parallel loop default(none) copy (da3(-n:n,-n:n)) firstprivate(n)
do i = 1,n
- da3(i,0) = i*3
+ da3(i, 0) = da3(i, 0) + 1 * i * 3
end do
!$acc end parallel loop
+
+ !$acc serial loop default(none) copy (da3(-n:n,-n:n)) firstprivate(n)
+ do i = 1,n
+ da3(i, 0) = da3(i, 0) + 1 * i * 3
+ end do
+ !$acc end serial loop
+
end subroutine foobar
do i = 1, 10
end do
!$acc end kernels loop
+
+ !$acc serial loop pcopyout(var)
+ do i = 1, 10
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop copyout(var%a)
+ do i = 1, 10
+ end do
+ !$acc end serial loop
+
+ !$acc serial pcopy(var)
+ !$acc end serial
+
+ !$acc serial pcopy(var%a)
+ do i = 1, 10
+ end do
+ !$acc end serial
end program derived_acc
!$acc parallel firstprivate (b(10:20)) ! { dg-error "Syntax error in OpenMP variable list" }
!$acc end parallel ! { dg-error "Unexpected !\\\$ACC END PARALLEL statement" }
+
+
+ !$acc serial firstprivate (a, b)
+ !$acc end serial
+
+ !$acc serial firstprivate (b(10:20)) ! { dg-error "Syntax error in OpenMP variable list" }
+ !$acc end serial ! { dg-error "Unexpected !\\\$ACC END SERIAL statement" }
+
end program test
b(i) = i
end do
+
!$acc parallel loop gang (static:*) num_gangs (10)
do i = 1, n
a(i) = b(i) + 0
end do
!$acc end parallel loop
+ call test (a, b, 20, n)
+
+
!$acc kernels loop gang (num:5, static:*)
do i = 1, n
a(i) = b(i) + 20
end do
!$acc end kernels loop
+
+ !$acc serial loop gang (static:*)
+ do i = 1, n
+ a(i) = b(i) + 0
+ end do
+ !$acc end serial loop
+
+ call test (a, b, 0, n)
+
+ !$acc serial loop gang (static:1)
+ do i = 1, n
+ a(i) = b(i) + 1
+ end do
+ !$acc end serial loop
+
+ call test (a, b, 1, n)
+
+ !$acc serial loop gang (static:2)
+ do i = 1, n
+ a(i) = b(i) + 2
+ end do
+ !$acc end serial loop
+
+ call test (a, b, 2, n)
+
+ !$acc serial loop gang (static:5)
+ do i = 1, n
+ a(i) = b(i) + 5
+ end do
+ !$acc end serial loop
+
+ call test (a, b, 5, n)
+
+ !$acc serial loop gang (static:20)
+ do i = 1, n
+ a(i) = b(i) + 20
+ end do
+ !$acc end serial loop
+
call test (a, b, 20, n)
end program main
end do
end subroutine test
-! { dg-final { scan-tree-dump-times "gang\\(static:\\\*\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "gang\\(static:1\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "gang\\(static:2\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "gang\\(static:5\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "gang\\(static:20\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "gang\\(static:\\\*\\)" 2 "omplower" } }
+! { dg-final { scan-tree-dump-times "gang\\(static:1\\)" 2 "omplower" } }
+! { dg-final { scan-tree-dump-times "gang\\(static:2\\)" 2 "omplower" } }
+! { dg-final { scan-tree-dump-times "gang\\(static:5\\)" 2 "omplower" } }
+! { dg-final { scan-tree-dump-times "gang\\(static:20\\)" 2 "omplower" } }
! { dg-final { scan-tree-dump-times "gang\\(num: 5 static:\\\*\\)" 1 "omplower" } }
! { dg-final { scan-tree-dump-times "gang\\(num: 30 static:20\\)" 1 "omplower" } }
!$acc kernels if (1) ! { dg-error "scalar LOGICAL expression" }
!$acc end kernels
+ !$acc serial if ! { dg-error "Expected '\\(' after 'if'" }
+ !$acc serial if () ! { dg-error "Invalid character" }
+ !$acc serial if (i) ! { dg-error "scalar LOGICAL expression" }
+ !$acc end serial
+ !$acc serial if (1) ! { dg-error "scalar LOGICAL expression" }
+ !$acc end serial
+
!$acc data if ! { dg-error "Expected '\\(' after 'if'" }
!$acc data if () ! { dg-error "Invalid character" }
!$acc data if (i) ! { dg-error "scalar LOGICAL expression" }
! at most one if clause may appear
!$acc parallel if (.false.) if (.false.) { dg-error "Duplicated 'if' clause" }
!$acc kernels if (.false.) if (.false.) { dg-error "Duplicated 'if' clause" }
+ !$acc serial if (.false.) if (.false.) { dg-error "Duplicated 'if' clause" }
!$acc data if (.false.) if (.false.) { dg-error "Duplicated 'if' clause" }
!$acc parallel if (x)
!$acc kernels if (i.gt.1)
!$acc end kernels
+ !$acc serial if (x)
+ !$acc end serial
+ !$acc serial if (.true.)
+ !$acc end serial
+ !$acc serial if (i.gt.1)
+ !$acc end serial
+
!$acc data if (x)
!$acc end data
!$acc data if (.true.)
real, pointer :: p1 => NULL()
complex :: c, d(10)
+
!$acc parallel private(i)
!$acc end parallel
!$acc parallel private (i) firstprivate (i) ! { dg-error "present on multiple clauses" }
!$acc end parallel
+
+ !$acc serial private(i)
+ !$acc end serial
+
+ !$acc serial private(a)
+ !$acc end serial
+
+ !$acc serial private(c, d)
+ !$acc end serial
+
+ !$acc serial private(i, j, k, l, a)
+ !$acc end serial
+
+ !$acc serial private (i) private (j)
+ !$acc end serial
+
+ !$acc serial private ! { dg-error "Failed to match clause" }
+
+ !$acc serial private() ! { dg-error "Syntax error" }
+
+ !$acc serial private(a(1:3)) ! { dg-error "Syntax error" }
+
+ !$acc serial private(10) ! { dg-error "Syntax error" }
+
+ !$acc serial private(/b/, /b/) ! { dg-error "present on multiple clauses" }
+ !$acc end serial
+
+ !$acc serial private(i, j, i) ! { dg-error "present on multiple clauses" }
+ !$acc end serial
+
+ !$acc serial private(p1)
+ !$acc end serial
+
+ !$acc serial firstprivate(i)
+ !$acc end serial
+
+ !$acc serial firstprivate(c, d)
+ !$acc end serial
+
+ !$acc serial firstprivate(a)
+ !$acc end serial
+
+ !$acc serial firstprivate(i, j, k, l, a)
+ !$acc end serial
+
+ !$acc serial firstprivate (i) firstprivate (j)
+ !$acc end serial
+
+ !$acc serial firstprivate ! { dg-error "Failed to match clause" }
+
+ !$acc serial firstprivate() ! { dg-error "Syntax error" }
+
+ !$acc serial firstprivate(a(1:3)) ! { dg-error "Syntax error" }
+
+ !$acc serial firstprivate(10) ! { dg-error "Syntax error" }
+
+ !$acc serial firstprivate (/b/, /b/) ! { dg-error "present on multiple clauses" }
+ !$acc end serial
+
+ !$acc serial firstprivate (i, j, i) ! { dg-error "present on multiple clauses" }
+ !$acc end serial
+
+ !$acc serial firstprivate(p1)
+ !$acc end serial
+
+ !$acc serial private (i) firstprivate (i) ! { dg-error "present on multiple clauses" }
+ !$acc end serial
+
+
!$acc host_data use_device(i) ! { dg-error "neither a POINTER nor an array" }
!$acc end host_data
do i = 1,5
enddo
!$acc end parallel loop ! { dg-error "Unexpected" }
+ !$acc serial loop reduction(+:10) ! { dg-error "Syntax error" }
+ do i = 1,5
+ enddo
+ !$acc end serial loop ! { dg-error "Unexpected" }
!$acc parallel loop
do i = 1,5
!$acc cache (10) ! { dg-error "Syntax error" }
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ !$acc cache (10) ! { dg-error "Syntax error" }
+ enddo
+ !$acc end serial loop
!$acc update device (10) ! { dg-error "Syntax error" }
!$acc update host (10) ! { dg-error "Syntax error" }
!$acc update self (10) ! { dg-error "Syntax error" }
do i = 1,10
enddo
!$acc end kernels loop
+ !$acc serial loop
+ do i = 1,10
+ enddo
+ !$acc serial loop
+ do i = 1,10
+ enddo
+ !$acc end serial loop
!$acc kernels loop reduction(max:i)
do i = 1,10
do i = 1,10
enddo
!$acc end kernels loop
+ !$acc serial loop
+ do i = 1,10
+ enddo
+ !$acc serial loop
+ do i = 1,10
+ enddo
+ !$acc end serial loop
!$acc kernels loop reduction(max:i)
do i = 1,10
-! See also "../../c-c++-common/goacc/loop-3.c".
+! See also "../../c-c++-common/goacc/loop-3-parallel.c".
program test
implicit none
--- /dev/null
+! See also "../../c-c++-common/goacc/loop-3-serial.c".
+
+program test
+ implicit none
+ integer :: i
+
+ !$acc serial
+ !$acc loop gang(5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc loop gang(num:5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc loop worker(5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc loop worker(num:5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc loop vector(5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc loop vector(length:5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+ !$acc end serial
+
+ !$acc serial loop gang(5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc serial loop gang(num:5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc serial loop worker(5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc serial loop worker(num:5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc serial loop vector(5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc serial loop vector(length:5) ! { dg-error "argument not permitted" }
+ DO i = 1,10
+ ENDDO
+end
--- /dev/null
+program test
+ implicit none
+ integer :: i, j
+
+ !$acc serial loop gang
+ DO i = 1,10
+ !$acc serial loop gang ! { dg-bogus "OpenACC construct inside of non-OpenACC region" "TODO" { xfail *-*-* } }
+ DO j = 1,10
+ ENDDO
+ ENDDO
+
+ !$acc serial loop worker
+ DO i = 1,10
+ !$acc serial loop worker ! { dg-bogus "OpenACC construct inside of non-OpenACC region" "TODO" { xfail *-*-* } }
+ DO j = 1,10
+ ENDDO
+ !$acc serial loop gang ! { dg-bogus "OpenACC construct inside of non-OpenACC region" "TODO" { xfail *-*-* } }
+ DO j = 1,10
+ ENDDO
+ ENDDO
+
+ !$acc serial loop vector
+ DO i = 1,10
+ !$acc serial loop vector ! { dg-bogus "OpenACC construct inside of non-OpenACC region" "TODO" { xfail *-*-* } }
+ DO j = 1,10
+ ENDDO
+ !$acc serial loop worker ! { dg-bogus "OpenACC construct inside of non-OpenACC region" "TODO" { xfail *-*-* } }
+ DO j = 1,10
+ ENDDO
+ !$acc serial loop gang ! { dg-bogus "OpenACC construct inside of non-OpenACC region" "TODO" { xfail *-*-* } }
+ DO j = 1,10
+ ENDDO
+ ENDDO
+end
--- /dev/null
+program test
+ implicit none
+ integer :: i, j
+
+ !$acc serial
+ !$acc loop tile ! { dg-error "Failed to match clause" }
+ DO i = 1,10
+ ENDDO
+ !$acc loop tile() ! { dg-error "Syntax error" }
+ DO i = 1,10
+ ENDDO
+ !$acc loop tile(1)
+ DO i = 1,10
+ ENDDO
+ !$acc loop tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc loop tile(2)
+ DO i = 1,10
+ DO j = 1,10
+ ENDDO
+ ENDDO
+ !$acc loop tile(-1) ! { dg-warning "must be positive" }
+ do i = 1,10
+ enddo
+ !$acc loop tile(i) ! { dg-error "constant expression" }
+ do i = 1,10
+ enddo
+ !$acc loop tile(2, 2, 1) ! { dg-error "not enough DO loops for tiled" }
+ do i = 1, 3
+ do j = 4, 6
+ end do
+ end do
+ !$acc loop tile(2, 2)
+ do i = 1, 5, 2
+ do j = i + 1, 7, i ! { dg-error "tiled loops don.t form rectangular iteration space" }
+ end do
+ end do
+ !$acc loop vector tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc loop worker tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc loop gang tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc loop vector gang tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc loop vector worker tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc loop gang worker tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc end serial
+
+ !$acc serial loop tile ! { dg-error "Failed to match clause" }
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop tile() ! { dg-error "Syntax error" }
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop tile(1)
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop tile(*, 1)
+ DO i = 1,10
+ DO j = 1,10
+ ENDDO
+ ENDDO
+ !$acc serial loop tile(-1) ! { dg-warning "must be positive" }
+ do i = 1,10
+ enddo
+ !$acc serial loop tile(i) ! { dg-error "constant expression" }
+ do i = 1,10
+ enddo
+ !$acc serial loop tile(2, 2, 1) ! { dg-error "not enough DO loops for tiled" }
+ do i = 1, 3
+ do j = 4, 6
+ end do
+ end do
+ !$acc serial loop tile(2, 2)
+ do i = 1, 5, 2
+ do j = i + 1, 7, i ! { dg-error "tiled loops don.t form rectangular iteration space" }
+ end do
+ end do
+ !$acc serial loop vector tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop worker tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop gang tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop vector gang tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop vector worker tile(*)
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop gang worker tile(*)
+ DO i = 1,10
+ ENDDO
+end
--- /dev/null
+! See also "../../c-c++-common/goacc/loop-2-serial.c".
+
+program test
+ implicit none
+ integer :: i, j
+
+ !$acc serial
+ !$acc loop auto
+ DO i = 1,10
+ ENDDO
+ !$acc loop gang
+ DO i = 1,10
+ ENDDO
+ !$acc loop gang(static:5)
+ DO i = 1,10
+ ENDDO
+ !$acc loop gang(static:*)
+ DO i = 1,10
+ ENDDO
+ !$acc loop gang
+ DO i = 1,10
+ !$acc loop vector
+ DO j = 1,10
+ ENDDO
+ !$acc loop worker
+ DO j = 1,10
+ ENDDO
+ !$acc loop gang ! { dg-error "inner loop uses same OpenACC parallelism as containing loop" }
+ DO j = 1,10
+ ENDDO
+ ENDDO
+ !$acc loop seq gang ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc loop worker
+ DO i = 1,10
+ ENDDO
+ !$acc loop worker
+ DO i = 1,10
+ !$acc loop vector
+ DO j = 1,10
+ ENDDO
+ !$acc loop worker ! { dg-error "inner loop uses same OpenACC parallelism as containing loop" }
+ DO j = 1,10
+ ENDDO
+ !$acc loop gang ! { dg-error "incorrectly nested OpenACC loop parallelism" }
+ DO j = 1,10
+ ENDDO
+ ENDDO
+ !$acc loop seq worker ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc loop gang worker
+ DO i = 1,10
+ ENDDO
+
+ !$acc loop vector
+ DO i = 1,10
+ ENDDO
+ !$acc loop vector
+ DO i = 1,10
+ !$acc loop vector ! { dg-error "inner loop uses same OpenACC parallelism as containing loop" }
+ DO j = 1,10
+ ENDDO
+ !$acc loop worker ! { dg-error "incorrectly nested OpenACC loop parallelism" }
+ DO j = 1,10
+ ENDDO
+ !$acc loop gang ! { dg-error "incorrectly nested OpenACC loop parallelism" }
+ DO j = 1,10
+ ENDDO
+ ENDDO
+ !$acc loop seq vector ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc loop gang vector
+ DO i = 1,10
+ ENDDO
+ !$acc loop worker vector
+ DO i = 1,10
+ ENDDO
+
+ !$acc loop auto
+ DO i = 1,10
+ ENDDO
+ !$acc loop seq auto ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc loop gang auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc loop worker auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc loop vector auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc end serial
+
+ !$acc serial loop auto
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop gang
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop gang(static:5)
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop gang(static:*)
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop seq gang ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+
+ !$acc serial loop worker
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop seq worker ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop gang worker
+ DO i = 1,10
+ ENDDO
+
+ !$acc serial loop vector
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop seq vector ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop gang vector
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop worker vector
+ DO i = 1,10
+ ENDDO
+
+ !$acc serial loop auto
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop seq auto ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop gang auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop worker auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+ !$acc serial loop vector auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
+ DO i = 1,10
+ ENDDO
+end
!$acc end parallel
!$acc end loop ! { dg-error "Unexpected" }
+ !$acc serial
+ !$acc loop
+ do i = 1,5
+ enddo
+ !$acc end serial
+ !$acc end loop ! { dg-error "Unexpected" }
+
+
! OpenACC does not support Fortran 2008 do concurrent statement
!$acc loop
do concurrent (i = 1:5) ! { dg-error "ACC LOOP cannot be a DO CONCURRENT loop" }
!$acc end parallel
!$acc end loop ! { dg-error "Unexpected" }
+ !$acc serial
+ !$acc loop
+ do i = 1,5
+ enddo
+ !$acc end serial
+ !$acc end loop ! { dg-error "Unexpected" }
+
+
! OpenACC does not support Fortran 2008 do concurrent statement
!$acc loop
do concurrent (i = 1:5) ! { dg-error "ACC LOOP cannot be a DO CONCURRENT loop" }
do i = 1, 100
end do
!$acc end parallel loop
+
+ !$acc serial loop reduction (+:j) copy (j) copyout(j) ! { dg-error "Symbol 'j' present on multiple clauses" }
+ do i = 1, 100
+ end do
+ !$acc end serial loop
+
end program combined
do j = 1, n
end do
end do
+
+
+ !$acc serial loop gang
+ do i = 1, n
+ !$acc loop gang ! { dg-error "inner loop uses same OpenACC parallelism as containing loop" }
+ do j = 1, n
+ end do
+
+ !$acc loop worker
+ do j = 1, n
+ end do
+
+ !$acc loop vector
+ do j = 1, n
+ end do
+ end do
+
+ !$acc serial loop worker
+ do i = 1, n
+ !$acc loop gang ! { dg-error "incorrectly nested OpenACC loop parallelism" }
+ do j = 1, n
+ end do
+
+ !$acc loop worker ! { dg-error "inner loop uses same OpenACC parallelism as containing loop" }
+ do j = 1, n
+ end do
+
+ !$acc loop vector
+ do j = 1, n
+ end do
+ end do
+
+ !$acc serial loop vector
+ do i = 1, n
+ !$acc loop gang ! { dg-error "incorrectly nested OpenACC loop parallelism" }
+ do j = 1, n
+ end do
+
+ !$acc loop worker ! { dg-error "incorrectly nested OpenACC loop parallelism" }
+ do j = 1, n
+ end do
+
+ !$acc loop vector ! { dg-error "inner loop uses same OpenACC parallelism as containing loop" }
+ do j = 1, n
+ end do
+ end do
+
end program np
--- /dev/null
+! Test cases of nested 'reduction' clauses expected to compile cleanly.
+
+! See also 'c-c++-common/goacc/nested-reductions-1-serial.c'.
+
+! { dg-additional-options -Wuninitialized }
+
+subroutine acc_serial ()
+ implicit none (type, external)
+ integer :: i, j, k, sum, diff
+
+ !$acc serial
+ ! implicit 'copy (sum, diff)'
+ ! { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ ! { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 }
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop collapse(2) reduction(+:sum)
+ do i = 1, 10
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(+:sum)
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop collapse(2) reduction(+:sum)
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(+:sum)
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum) reduction(-:diff)
+ do i = 1, 10
+ !$acc loop reduction(+:sum)
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop reduction(-:diff)
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+ !$acc end serial
+end subroutine acc_serial
+
+! The same tests as above, but using a combined serial loop construct.
+
+subroutine acc_serial_loop ()
+ implicit none (type, external)
+ integer :: h, i, j, k, l, sum, diff
+
+ !$acc serial loop
+ ! implicit 'copy (sum, diff)'
+ ! { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ ! { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 }
+ do h = 1, 10
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop collapse(2) reduction(+:sum)
+ do i = 1, 10
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(+:sum)
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop collapse(2) reduction(+:sum)
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "insufficient partitioning available to parallelize loop" }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum) reduction(-:diff)
+ do i = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "insufficient partitioning available to parallelize loop" }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop reduction(-:diff) ! { dg-warning "insufficient partitioning available to parallelize loop" }
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+ end do
+end subroutine acc_serial_loop
+
+! The same tests as above, but now the outermost reduction clause is on
+! the serial region, not the outermost loop. */
+
+subroutine acc_serial_reduction ()
+ implicit none (type, external)
+ integer :: i, j, k, sum, diff
+
+ !$acc serial reduction(+:sum)
+ ! implicit 'copy (sum, diff)'
+ ! { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ ! { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 }
+ do i = 1, 10
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ do i = 1, 10
+ !$acc loop
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ do i = 1, 10
+ do j = 1, 10
+ !$acc loop
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(+:sum)
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum) reduction(-:diff)
+ do i = 1, 10
+ !$acc loop reduction(+:sum)
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop reduction(-:diff)
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(+:sum)
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop reduction(-:diff)
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(+:sum)
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+ !$acc end serial
+end subroutine acc_serial_reduction
+
+! The same tests as above, but using a combined serial loop construct, and
+! the outermost reduction clause is on that one, not the outermost loop. */
+subroutine acc_serial_loop_reduction ()
+ implicit none (type, external)
+ integer :: h, i, j, k, sum, diff
+
+ !$acc serial loop reduction(+:sum)
+ ! implicit 'copy (sum, diff)'
+ ! { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ ! { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 }
+ do h = 1, 10
+ do i = 1, 10
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ do i = 1, 10
+ !$acc loop
+ do j = 1, 10
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ do i = 1, 10
+ do j = 1, 10
+ !$acc loop
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "insufficient partitioning available to parallelize loop" }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum) reduction(-:diff)
+ do i = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "insufficient partitioning available to parallelize loop" }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop reduction(-:diff) ! { dg-warning "insufficient partitioning available to parallelize loop" }
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "insufficient partitioning available to parallelize loop" }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop reduction(-:diff) ! { dg-warning "insufficient partitioning available to parallelize loop" }
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "insufficient partitioning available to parallelize loop" }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop ! { dg-warning "insufficient partitioning available to parallelize loop" }
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+ end do
+end subroutine acc_serial_loop_reduction
--- /dev/null
+! Test erroneous cases of nested 'reduction' clauses.
+
+! See also 'c-c++-common/goacc/nested-reductions-2-serial.c'.
+
+! { dg-additional-options -Wuninitialized }
+
+subroutine acc_serial ()
+ implicit none (type, external)
+ integer :: i, j, k, l, sum, diff
+
+ !$acc serial
+ ! implicit 'copy (sum, diff)'
+ ! { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ ! { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 }
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop collapse(2) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do j = 1, 10
+ do k = 1, 10
+ !$acc loop reduction(+:sum)
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do j = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(+:sum)
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do j = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do j = 1, 10
+ !$acc loop reduction(-:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do j = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do j = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum) reduction(-:diff)
+ do i = 1, 10
+ !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop reduction(+:sum) ! { dg-warning "nested loop in reduction needs reduction clause for .diff." }
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+ !$acc end serial
+end subroutine acc_serial
+
+! The same tests as above, but using a combined serial loop construct.
+
+subroutine acc_serial_loop ()
+ implicit none (type, external)
+ integer :: h, i, j, k, l, sum, diff
+
+ !$acc serial loop
+ ! implicit 'copy (sum, diff)'
+ ! { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ ! { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 }
+ do h = 1, 10
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop collapse(2) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ do k = 1, 10
+ !$acc loop reduction(+:sum)
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(+:sum)
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(-:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(+:sum) reduction(-:diff)
+ do i = 1, 10
+ !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop reduction(+:sum) ! { dg-warning "nested loop in reduction needs reduction clause for .diff." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+ end do
+end subroutine acc_serial_loop
+
+! The same tests as above, but now the outermost reduction clause is on
+! the serial region, not the outermost loop.
+
+subroutine acc_serial_reduction ()
+ implicit none (type, external)
+ integer :: i, j, k, l, sum, diff
+
+ !$acc serial reduction(+:sum)
+ ! implicit 'copy (sum, diff)'
+ ! { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ ! { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 }
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop collapse(2) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do j = 1, 10
+ do k = 1, 10
+ !$acc loop reduction(+:sum)
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do j = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(+:sum)
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do j = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do j = 1, 10
+ !$acc loop reduction(-:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(max:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do j = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(max:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do j = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop reduction(+:sum) ! { dg-warning "nested loop in reduction needs reduction clause for .diff." }
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+ !$acc end serial
+end subroutine acc_serial_reduction
+
+! The same tests as above, but using a combined serial loop construct, and
+! the outermost reduction clause is on that one, not the outermost loop. */
+subroutine acc_serial_loop_reduction ()
+ implicit none (type, external)
+ integer :: h, i, j, k, l, sum, diff
+
+ !$acc serial loop reduction(+:sum)
+ ! implicit 'copy (sum, diff)'
+ ! { dg-warning {'sum' is used uninitialized} TODO { xfail *-*-* } .-2 }
+ ! { dg-warning {'diff' is used uninitialized} TODO { xfail *-*-* } .-3 }
+ do h = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop collapse(2) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ do k = 1, 10
+ !$acc loop reduction(+:sum)
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(+:sum)
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(-:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(max:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(max:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do i = 1, 10
+ !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do k = 1, 10
+ !$acc loop reduction(*:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+ do l = 1, 10
+ sum = 1
+ end do
+ end do
+ end do
+ end do
+
+ !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ do i = 1, 10
+ !$acc loop reduction(-:diff) ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(+:sum)
+ do k = 1, 10
+ sum = 1
+ end do
+ end do
+
+ !$acc loop reduction(+:sum) ! { dg-warning "nested loop in reduction needs reduction clause for .diff." }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, 10
+ !$acc loop reduction(-:diff)
+ do k = 1, 10
+ diff = 1
+ end do
+ end do
+ end do
+ end do
+end subroutine acc_serial_loop_reduction
--- /dev/null
+! { dg-do compile }
+
+! The OpenACC specification allows nested compute constructs, but we don't
+! support that yet. */
+
+program test
+ implicit none
+
+ integer :: i
+
+ !$acc parallel
+ !$acc kernels ! { dg-bogus ".kernels. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
+ !$acc end kernels
+ !$acc end parallel
+
+ !$acc parallel
+ !$acc parallel ! { dg-bogus ".parallel. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
+ !$acc end parallel
+ !$acc end parallel
+
+ !$acc parallel
+ !$acc serial ! { dg-bogus ".serial. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
+ !$acc end serial
+ !$acc end parallel
+
+ !$acc parallel
+ !$acc parallel ! { dg-bogus ".parallel. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
+ !$acc end parallel
+ !$acc kernels ! { dg-bogus ".kernels. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
+ !$acc end kernels
+ !$acc serial ! { dg-bogus ".serial. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
+ !$acc end serial
+ !$acc end parallel
+
+
+ !$acc kernels
+ !$acc kernels ! { dg-bogus ".kernels. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
+ !$acc end kernels
+ !$acc end kernels
+
+ !$acc kernels
+ !$acc parallel ! { dg-bogus ".parallel. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
+ !$acc end parallel
+ !$acc end kernels
+
+ !$acc kernels
+ !$acc serial ! { dg-bogus ".serial. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
+ !$acc end serial
+ !$acc end kernels
+
+ !$acc kernels
+ !$acc parallel ! { dg-bogus ".parallel. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
+ !$acc end parallel
+ !$acc kernels ! { dg-bogus ".kernels. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
+ !$acc end kernels
+ !$acc serial ! { dg-bogus ".serial. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
+ !$acc end serial
+ !$acc end kernels
+
+
+ !$acc serial
+ !$acc kernels ! { dg-bogus ".kernels. construct inside of .serial. region" "not implemented" { xfail *-*-* } }
+ !$acc end kernels
+ !$acc end serial
+
+ !$acc serial
+ !$acc parallel ! { dg-bogus ".parallel. construct inside of .serial. region" "not implemented" { xfail *-*-* } }
+ !$acc end parallel
+ !$acc end serial
+
+ !$acc serial
+ !$acc serial ! { dg-bogus ".serial. construct inside of .serial. region" "not implemented" { xfail *-*-* } }
+ !$acc end serial
+ !$acc end serial
+
+ !$acc serial
+ !$acc parallel ! { dg-bogus ".parallel. construct inside of .serial. region" "not implemented" { xfail *-*-* } }
+ !$acc end parallel
+ !$acc kernels ! { dg-bogus ".kernels. construct inside of .serial. region" "not implemented" { xfail *-*-* } }
+ !$acc end kernels
+ !$acc serial ! { dg-bogus ".serial. construct inside of .serial. region" "not implemented" { xfail *-*-* } }
+ !$acc end serial
+ !$acc end serial
+
+
+ !$acc parallel
+ !$acc data ! { dg-error ".data. construct inside of .parallel. region" }
+ !$acc end data
+ !$acc end parallel
+
+ !$acc kernels
+ !$acc data ! { dg-error ".data. construct inside of .kernels. region" }
+ !$acc end data
+ !$acc end kernels
+
+ !$acc serial
+ !$acc data ! { dg-error ".data. construct inside of .serial. region" }
+ !$acc end data
+ !$acc end serial
+
+end program test
+++ /dev/null
-! { dg-do compile }
-
-! OpenACC 2.0 allows nested parallel/kernels regions, but this is not yet
-! supported.
-
-program test
- implicit none
-
- integer :: i
-
- !$acc parallel
- !$acc kernels ! { dg-bogus ".kernels. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
- !$acc end kernels
- !$acc end parallel
-
- !$acc parallel
- !$acc parallel ! { dg-bogus ".parallel. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
- !$acc end parallel
- !$acc end parallel
-
- !$acc parallel
- !$acc parallel ! { dg-bogus ".parallel. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
- !$acc end parallel
- !$acc kernels ! { dg-bogus ".kernels. construct inside of .parallel. region" "not implemented" { xfail *-*-* } }
- !$acc end kernels
- !$acc end parallel
-
- !$acc kernels
- !$acc kernels ! { dg-bogus ".kernels. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
- !$acc end kernels
- !$acc end kernels
-
- !$acc kernels
- !$acc parallel ! { dg-bogus ".parallel. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
- !$acc end parallel
- !$acc end kernels
-
- !$acc kernels
- !$acc parallel ! { dg-bogus ".parallel. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
- !$acc end parallel
- !$acc kernels ! { dg-bogus ".kernels. construct inside of .kernels. region" "not implemented" { xfail *-*-* } }
- !$acc end kernels
- !$acc end kernels
-
- !$acc parallel
- !$acc data ! { dg-error ".data. construct inside of .parallel. region" }
- !$acc end data
- !$acc end parallel
-
- !$acc kernels
- !$acc data ! { dg-error ".data. construct inside of .kernels. region" }
- !$acc end data
- !$acc end kernels
-
-end program test
!$acc end data
!$acc parallel private (a) ! { dg-error "not a variable" }
!$acc end parallel
+ !$acc serial private (a) ! { dg-error "not a variable" }
+ !$acc end serial
!$acc host_data use_device (a) ! { dg-error "not a variable" }
!$acc end host_data
!$acc parallel loop reduction(+:a) ! { dg-error "not a variable" }
do i = 1,5
enddo
!$acc end parallel loop
+ !$acc serial loop reduction(+:a) ! { dg-error "not a variable" }
+ do i = 1,5
+ enddo
+ !$acc end serial loop
!$acc parallel loop
do i = 1,5
!$acc cache (a) ! { dg-error "not a variable" }
enddo
!$acc end parallel loop
+ !$acc serial loop
+ do i = 1,5
+ !$acc cache (a) ! { dg-error "not a variable" }
+ enddo
+ !$acc end serial loop
!$acc update device (a) ! { dg-error "not a variable" }
!$acc update host (a) ! { dg-error "not a variable" }
!$acc update self (a) ! { dg-error "not a variable" }
f7 = 1
end
+real function f_serial ()
+!$acc serial
+!$acc end serial
+ f_serial = 1
+end
+
real function f8 ()
!$acc data
!$acc end data
k = k + 1
end do
!$acc end parallel
+
+
+! !$acc serial private (k) reduction (+:k)
+! do i = 1, n
+! k = k + 1
+! end do
+! !$acc end serial
+
+ !$acc serial private (k)
+ k = 0
+ !$acc loop reduction (+:k)
+ ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
+ do i = 1, n
+ k = k + 1
+ end do
+ !$acc end serial
+
end program test
--- /dev/null
+! Explicit 'private' clauses related to 'do' loops inside an OpenACC
+! 'serial' construct.
+
+! { dg-additional-options "-fdump-tree-original -fdump-tree-gimple" }
+
+! (The 'independent' clauses are used as end of directive markers in tree dump
+! scanning.)
+
+program test
+ implicit none
+ integer :: i0_1
+ integer :: i0_2, j0_2
+ integer :: i1_s
+ integer :: i1_c
+ integer :: i2_1_s, j2_1_s
+ integer :: i2_1_c, j2_1_c
+ integer :: i2_2_s, j2_2_s
+ integer :: i2_3_s, j2_3_s
+ integer :: i2_3_c, j2_3_c
+ integer :: i3_1_s, j3_1_s, k3_1_s
+ integer :: i3_1_c, j3_1_c, k3_1_c
+ integer :: i3_2_s, j3_2_s, k3_2_s
+ integer :: i3_2_c, j3_2_c, k3_2_c
+ integer :: i3_3_s, j3_3_s, k3_3_s
+ integer :: i3_3_c, j3_3_c, k3_3_c
+ integer :: i3_4_s, j3_4_s, k3_4_s
+ integer :: i3_4_c, j3_4_c, k3_4_c
+ integer :: i3_5_s, j3_5_s, k3_5_s
+
+ !$acc serial private(i0_1)
+ ! { dg-final { scan-tree-dump-times "#pragma acc serial private\\(i0_1\\)" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_serial private\\(i0_1\\)" 1 "gimple" } }
+ ! { dg-final { scan-tree-dump-times "firstprivate\\(i0_1\\)" 0 "gimple" } }
+ do i0_1 = 1, 100
+ end do
+ !$acc end serial
+
+ !$acc serial private(i0_2, j0_2)
+ ! { dg-final { scan-tree-dump-times "#pragma acc serial private\\(i0_2\\) private\\(j0_2\\)" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_serial private\\(i0_2\\) private\\(j0_2\\)" 1 "gimple" } }
+ ! { dg-final { scan-tree-dump-times "firstprivate\\(i0_2\\)" 0 "gimple" } }
+ ! { dg-final { scan-tree-dump-times "firstprivate\\(j0_2\\)" 0 "gimple" } }
+ do i0_2 = 1, 100
+ do j0_2 = 1, 100
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial
+ !$acc loop private(i1_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i1_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i1_s\\) independent" 1 "gimple" } }
+ do i1_s = 1, 100
+ end do
+ !$acc end serial
+
+ !$acc serial loop private(i1_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i1_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i1_c\\) independent" 1 "gimple" } }
+ do i1_c = 1, 100
+ end do
+
+ !$acc serial
+ !$acc loop private(i2_1_s, j2_1_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_1_s\\) private\\(j2_1_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_1_s\\) private\\(j2_1_s\\) independent" 1 "gimple" } }
+ do i2_1_s = 1, 100
+ do j2_1_s = 1, 100
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop private(i2_1_c, j2_1_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_1_c\\) private\\(j2_1_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_1_c\\) private\\(j2_1_c\\) independent" 1 "gimple" } }
+ do i2_1_c = 1, 100
+ do j2_1_c = 1, 100
+ end do
+ end do
+
+ !$acc serial private(i2_2_s)
+ ! { dg-final { scan-tree-dump-times "#pragma acc serial private\\(i2_2_s\\)" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_serial private\\(i2_2_s\\)" 1 "gimple" } }
+ ! { dg-final { scan-tree-dump-times "firstprivate\\(i2_2_s\\)" 0 "gimple" } }
+ do i2_2_s = 1, 100
+ !$acc loop private(j2_2_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_2_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_2_s\\) independent" 1 "gimple" } }
+ do j2_2_s = 1, 100
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial
+ !$acc loop private(i2_3_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_3_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_3_s\\) independent" 1 "gimple" } }
+ do i2_3_s = 1, 100
+ !$acc loop private(j2_3_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_3_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_3_s\\) independent" 1 "gimple" } }
+ do j2_3_s = 1, 100
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop private(i2_3_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_3_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_3_c\\) independent" 1 "gimple" } }
+ do i2_3_c = 1, 100
+ !$acc loop private(j2_3_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_3_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_3_c\\) independent" 1 "gimple" } }
+ do j2_3_c = 1, 100
+ end do
+ end do
+
+ !$acc serial
+ !$acc loop private(i3_1_s, j3_1_s, k3_1_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_1_s\\) private\\(j3_1_s\\) private\\(k3_1_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_1_s\\) private\\(j3_1_s\\) private\\(k3_1_s\\) independent" 1 "gimple" } }
+ do i3_1_s = 1, 100
+ do j3_1_s = 1, 100
+ do k3_1_s = 1, 100
+ end do
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop private(i3_1_c, j3_1_c, k3_1_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_1_c\\) private\\(j3_1_c\\) private\\(k3_1_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_1_c\\) private\\(j3_1_c\\) private\\(k3_1_c\\) independent" 1 "gimple" } }
+ do i3_1_c = 1, 100
+ do j3_1_c = 1, 100
+ do k3_1_c = 1, 100
+ end do
+ end do
+ end do
+
+ !$acc serial
+ !$acc loop private(i3_2_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_2_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_2_s\\) independent" 1 "gimple" } }
+ do i3_2_s = 1, 100
+ !$acc loop private(j3_2_s, k3_2_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_2_s\\) private\\(k3_2_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_2_s\\) private\\(k3_2_s\\) independent" 1 "gimple" } }
+ do j3_2_s = 1, 100
+ do k3_2_s = 1, 100
+ end do
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop private(i3_2_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_2_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_2_c\\) independent" 1 "gimple" } }
+ do i3_2_c = 1, 100
+ !$acc loop private(j3_2_c, k3_2_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_2_c\\) private\\(k3_2_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_2_c\\) private\\(k3_2_c\\) independent" 1 "gimple" } }
+ do j3_2_c = 1, 100
+ do k3_2_c = 1, 100
+ end do
+ end do
+ end do
+
+ !$acc serial
+ !$acc loop private(i3_3_s, j3_3_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_3_s\\) private\\(j3_3_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_3_s\\) private\\(j3_3_s\\) independent" 1 "gimple" } }
+ do i3_3_s = 1, 100
+ do j3_3_s = 1, 100
+ !$acc loop private(k3_3_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_3_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_3_s\\) independent" 1 "gimple" } }
+ do k3_3_s = 1, 100
+ end do
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop private(i3_3_c, j3_3_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_3_c\\) private\\(j3_3_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_3_c\\) private\\(j3_3_c\\) independent" 1 "gimple" } }
+ do i3_3_c = 1, 100
+ do j3_3_c = 1, 100
+ !$acc loop private(k3_3_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_3_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_3_c\\) independent" 1 "gimple" } }
+ do k3_3_c = 1, 100
+ end do
+ end do
+ end do
+
+ !$acc serial
+ !$acc loop private(i3_4_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_4_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_4_s\\) independent" 1 "gimple" } }
+ do i3_4_s = 1, 100
+ !$acc loop private(j3_4_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_4_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_4_s\\) independent" 1 "gimple" } }
+ do j3_4_s = 1, 100
+ !$acc loop private(k3_4_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_4_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_4_s\\) independent" 1 "gimple" } }
+ do k3_4_s = 1, 100
+ end do
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop private(i3_4_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_4_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_4_c\\) independent" 1 "gimple" } }
+ do i3_4_c = 1, 100
+ !$acc loop private(j3_4_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_4_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_4_c\\) independent" 1 "gimple" } }
+ do j3_4_c = 1, 100
+ !$acc loop private(k3_4_c) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_4_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_4_c\\) independent" 1 "gimple" } }
+ do k3_4_c = 1, 100
+ end do
+ end do
+ end do
+
+ !$acc serial private(i3_5_s)
+ ! { dg-final { scan-tree-dump-times "#pragma acc serial private\\(i3_5_s\\)" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_serial private\\(i3_5_s\\)" 1 "gimple" } }
+ ! { dg-final { scan-tree-dump-times "firstprivate\\(i3_5_s\\)" 0 "gimple" } }
+ do i3_5_s = 1, 100
+ !$acc loop private(j3_5_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_5_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_5_s\\) independent" 1 "gimple" } }
+ do j3_5_s = 1, 100
+ !$acc loop private(k3_5_s) independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_5_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_5_s\\) independent" 1 "gimple" } }
+ do k3_5_s = 1, 100
+ end do
+ end do
+ end do
+ !$acc end serial
+end program test
--- /dev/null
+! Predetermined 'private' clauses related to 'do' loops inside an OpenACC
+! 'serial' construct.
+
+! { dg-additional-options "-fdump-tree-original -fdump-tree-gimple" }
+
+! (The 'independent' clauses are used as end of directive markers in tree dump
+! scanning.)
+
+program test
+ implicit none
+ integer :: i0_1
+ integer :: i0_2, j0_2
+ integer :: i1_s
+ integer :: i1_c
+ integer :: i2_1_s, j2_1_s
+ integer :: i2_1_c, j2_1_c
+ integer :: i2_2_s, j2_2_s
+ integer :: i2_3_s, j2_3_s
+ integer :: i2_3_c, j2_3_c
+ integer :: i3_1_s, j3_1_s, k3_1_s
+ integer :: i3_1_c, j3_1_c, k3_1_c
+ integer :: i3_2_s, j3_2_s, k3_2_s
+ integer :: i3_2_c, j3_2_c, k3_2_c
+ integer :: i3_3_s, j3_3_s, k3_3_s
+ integer :: i3_3_c, j3_3_c, k3_3_c
+ integer :: i3_4_s, j3_4_s, k3_4_s
+ integer :: i3_4_c, j3_4_c, k3_4_c
+ integer :: i3_5_s, j3_5_s, k3_5_s
+
+ !$acc serial
+ ! { dg-final { scan-tree-dump-times "private\\(i0_1\\)" 1 "original" { xfail *-*-* } } } ! PR90067
+ ! { dg-final { scan-tree-dump-times "private\\(i0_1\\)" 1 "gimple" } }
+ ! { dg-final { scan-tree-dump-times "firstprivate\\(i0_1\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+ ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_serial firstprivate\\(i0_1\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+ do i0_1 = 1, 100
+ end do
+ !$acc end serial
+
+ !$acc serial
+ ! { dg-final { scan-tree-dump-times "private\\(i0_2\\)" 1 "original" { xfail *-*-* } } } ! PR90067
+ ! { dg-final { scan-tree-dump-times "private\\(j0_2\\)" 1 "original" { xfail *-*-* } } } ! PR90067
+ ! { dg-final { scan-tree-dump-times "private\\(i0_2\\)" 1 "gimple" } }
+ ! { dg-final { scan-tree-dump-times "private\\(j0_2\\)" 1 "gimple" } }
+ ! { dg-final { scan-tree-dump-times "firstprivate\\(i0_2\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+ ! { dg-final { scan-tree-dump-times "firstprivate\\(j0_2\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+ ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_serial firstprivate\\(j0_2\\) firstprivate\\(i0_2\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+ do i0_2 = 1, 100
+ do j0_2 = 1, 100
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i1_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i1_s\\) independent" 1 "gimple" } }
+ do i1_s = 1, 100
+ end do
+ !$acc end serial
+
+ !$acc serial loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i1_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i1_c\\) independent" 1 "gimple" } }
+ do i1_c = 1, 100
+ end do
+
+ !$acc serial
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_1_s\\) private\\(j2_1_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_1_s\\) private\\(j2_1_s\\) independent" 1 "gimple" } }
+ do i2_1_s = 1, 100
+ do j2_1_s = 1, 100
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_1_c\\) private\\(j2_1_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_1_c\\) private\\(j2_1_c\\) independent" 1 "gimple" } }
+ do i2_1_c = 1, 100
+ do j2_1_c = 1, 100
+ end do
+ end do
+
+ !$acc serial
+ ! { dg-final { scan-tree-dump-times "private\\(i2_2_s\\)" 1 "original" { xfail *-*-* } } } ! PR90067
+ ! { dg-final { scan-tree-dump-times "private\\(i2_2_s\\)" 1 "gimple" } }
+ ! { dg-final { scan-tree-dump-times "firstprivate\\(i2_2_s\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+ ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_serial firstprivate\\(i2_2_s\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+ do i2_2_s = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_2_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_2_s\\) independent" 1 "gimple" } }
+ do j2_2_s = 1, 100
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_3_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_3_s\\) independent" 1 "gimple" } }
+ do i2_3_s = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_3_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_3_s\\) independent" 1 "gimple" } }
+ do j2_3_s = 1, 100
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_3_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i2_3_c\\) independent" 1 "gimple" } }
+ do i2_3_c = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_3_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j2_3_c\\) independent" 1 "gimple" } }
+ do j2_3_c = 1, 100
+ end do
+ end do
+
+ !$acc serial
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_1_s\\) private\\(j3_1_s\\) private\\(k3_1_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_1_s\\) private\\(j3_1_s\\) private\\(k3_1_s\\) independent" 1 "gimple" } }
+ do i3_1_s = 1, 100
+ do j3_1_s = 1, 100
+ do k3_1_s = 1, 100
+ end do
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_1_c\\) private\\(j3_1_c\\) private\\(k3_1_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_1_c\\) private\\(j3_1_c\\) private\\(k3_1_c\\) independent" 1 "gimple" } }
+ do i3_1_c = 1, 100
+ do j3_1_c = 1, 100
+ do k3_1_c = 1, 100
+ end do
+ end do
+ end do
+
+ !$acc serial
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_2_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_2_s\\) independent" 1 "gimple" } }
+ do i3_2_s = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_2_s\\) private\\(k3_2_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_2_s\\) private\\(k3_2_s\\) independent" 1 "gimple" } }
+ do j3_2_s = 1, 100
+ do k3_2_s = 1, 100
+ end do
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_2_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_2_c\\) independent" 1 "gimple" } }
+ do i3_2_c = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_2_c\\) private\\(k3_2_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_2_c\\) private\\(k3_2_c\\) independent" 1 "gimple" } }
+ do j3_2_c = 1, 100
+ do k3_2_c = 1, 100
+ end do
+ end do
+ end do
+
+ !$acc serial
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_3_s\\) private\\(j3_3_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_3_s\\) private\\(j3_3_s\\) independent" 1 "gimple" } }
+ do i3_3_s = 1, 100
+ do j3_3_s = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_3_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_3_s\\) independent" 1 "gimple" } }
+ do k3_3_s = 1, 100
+ end do
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_3_c\\) private\\(j3_3_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_3_c\\) private\\(j3_3_c\\) independent" 1 "gimple" } }
+ do i3_3_c = 1, 100
+ do j3_3_c = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_3_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_3_c\\) independent" 1 "gimple" } }
+ do k3_3_c = 1, 100
+ end do
+ end do
+ end do
+
+ !$acc serial
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_4_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_4_s\\) independent" 1 "gimple" } }
+ do i3_4_s = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_4_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_4_s\\) independent" 1 "gimple" } }
+ do j3_4_s = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_4_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_4_s\\) independent" 1 "gimple" } }
+ do k3_4_s = 1, 100
+ end do
+ end do
+ end do
+ !$acc end serial
+
+ !$acc serial loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_4_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(i3_4_c\\) independent" 1 "gimple" } }
+ do i3_4_c = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_4_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_4_c\\) independent" 1 "gimple" } }
+ do j3_4_c = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_4_c\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_4_c\\) independent" 1 "gimple" } }
+ do k3_4_c = 1, 100
+ end do
+ end do
+ end do
+
+ !$acc serial
+ ! { dg-final { scan-tree-dump-times "private\\(i3_5_s\\)" 1 "original" { xfail *-*-* } } } ! PR90067
+ ! { dg-final { scan-tree-dump-times "private\\(i3_5_s\\)" 1 "gimple" } }
+ ! { dg-final { scan-tree-dump-times "firstprivate\\(i3_5_s\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+ ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_serial firstprivate\\(i3_5_s\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+ do i3_5_s = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_5_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(j3_5_s\\) independent" 1 "gimple" } }
+ do j3_5_s = 1, 100
+ !$acc loop independent
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_5_s\\) independent" 1 "original" } }
+ ! { dg-final { scan-tree-dump-times "#pragma acc loop private\\(k3_5_s\\) independent" 1 "gimple" } }
+ do k3_5_s = 1, 100
+ end do
+ end do
+ end do
+ !$acc end serial
+end program test
contains
elemental subroutine test1
!$acc parallel ! { dg-error "may not appear in PURE procedures" }
+ !$acc serial ! { dg-error "may not appear in PURE procedures" }
end subroutine test1
pure subroutine test2
!$acc parallel ! { dg-error "may not appear in PURE procedures" }
+ !$acc serial ! { dg-error "may not appear in PURE procedures" }
end subroutine test2
! Implicit pure
elemental real function test3(x)
real, intent(in) :: x
!$acc parallel ! { dg-error "may not appear in PURE procedures" }
+ !$acc serial ! { dg-error "may not appear in PURE procedures" }
test3 = x*x
end function test3
pure real function test4(x)
real, intent(in) :: x
!$acc parallel ! { dg-error "may not appear in PURE procedures" }
+ !$acc serial ! { dg-error "may not appear in PURE procedures" }
test4 = x
end function test4
do i = 1,10
x = x + 0.3
enddo
+ !$acc serial loop collapse(1) reduction(+:x)
+ do i = 1,10
+ x = x + 0.3
+ enddo
print *, x
end subroutine test5
do i = 1,10
x = x + 0.3
enddo
+ !$acc serial loop collapse(1) reduction(+:x)
+ do i = 1,10
+ x = x + 0.3
+ enddo
test6 = x
end function test6
!$acc parallel
test7 = x
!$acc end parallel
+ !$acc serial
+ test7 = x
+ !$acc end serial
end function test7
subroutine test8
x = x + 0.3
end critical
enddo
+ !$acc serial loop collapse(1) reduction(+:x)
+ do i = 1,10
+ critical ! { dg-error "CRITICAL block inside of" }
+ x = x + 0.3
+ end critical
+ enddo
print *, x
end subroutine test8
! { dg-do compile }
! { dg-additional-options "-fdump-tree-gimple" }
+! See also '../../c-c++-common/goacc/combined-reduction.c'.
+
subroutine foo ()
implicit none
- integer :: p,k
+ integer :: p, k, s
integer :: a
+
!$acc parallel loop reduction(+:a)
do p = 1,5
enddo
!$acc end parallel loop
+
!$acc kernels loop reduction(+:a)
do k = 2,6
enddo
!$acc end kernels loop
+
+ !$acc serial loop reduction(+:a)
+ do s = 1,5
+ enddo
+ !$acc end serial loop
+
end subroutine
! { dg-final { scan-tree-dump-times "target oacc_parallel reduction..:a. map.tofrom.a." 1 "gimple" } }
! { dg-final { scan-tree-dump-times "acc loop private.p. reduction..:a." 1 "gimple" } }
! { dg-final { scan-tree-dump-times "target oacc_kernels map.force_tofrom:a .len: 4.." 1 "gimple" } }
! { dg-final { scan-tree-dump-times "acc loop private.k. reduction..:a." 1 "gimple" } }
+! { dg-final { scan-tree-dump-times "target oacc_serial reduction..:a. map.tofrom.a." 1 "gimple" } }
+! { dg-final { scan-tree-dump-times "acc loop private.s. reduction..:a." 1 "gimple" } }
!$acc end parallel
!$acc parallel reduction (+:i2) firstprivate(i2) ! { dg-error "invalid private reduction on .i2." }
!$acc end parallel
+
+!$acc serial reduction (+:i1) private(i1) ! { dg-error "invalid private reduction on .i1." }
+!$acc end serial
+!$acc serial reduction (+:i2) firstprivate(i2) ! { dg-error "invalid private reduction on .i2." }
+!$acc end serial
+
end subroutine foo
!$acc parallel reduction(+:v1,v2) pcreate(v1,v2) ! { dg-warning "incompatible data clause" }
!$acc end parallel
+
+
+ !$acc serial reduction(+:v1,v2)
+ !$acc end serial
+
+ !$acc serial reduction(+:v1,v2) copy(v1,v2)
+ !$acc end serial
+
+ !$acc serial reduction(+:v1,v2) pcopy(v1,v2)
+ !$acc end serial
+
+ !$acc serial reduction(+:v1,v2) present(v1,v2)
+ !$acc end serial
+
+ !$acc serial reduction(+:v1,v2) copyin(v1,v2) ! { dg-warning "incompatible data clause" }
+ !$acc end serial
+
+ !$acc serial reduction(+:v1,v2) pcopyin(v1,v2) ! { dg-warning "incompatible data clause" }
+ !$acc end serial
+
+ !$acc serial reduction(+:v1,v2) copyout(v1,v2) ! { dg-warning "incompatible data clause" }
+ !$acc end serial
+
+ !$acc serial reduction(+:v1,v2) pcopyout(v1,v2) ! { dg-warning "incompatible data clause" }
+ !$acc end serial
+
+ !$acc serial reduction(+:v1,v2) create(v1,v2) ! { dg-warning "incompatible data clause" }
+ !$acc end serial
+
+ !$acc serial reduction(+:v1,v2) pcreate(v1,v2) ! { dg-warning "incompatible data clause" }
+ !$acc end serial
+
end program test
-! { dg-final { scan-tree-dump-times "map.tofrom:v1" 9 "gimple" } }
-! { dg-final { scan-tree-dump-times "map.tofrom:v2" 9 "gimple" } }
-! { dg-final { scan-tree-dump-times "map.force_present:v1" 1 "gimple" } }
-! { dg-final { scan-tree-dump-times "map.force_present:v2" 1 "gimple" } }
+! { dg-final { scan-tree-dump-times "map.tofrom:v1" 18 "gimple" } }
+! { dg-final { scan-tree-dump-times "map.tofrom:v2" 18 "gimple" } }
+! { dg-final { scan-tree-dump-times "map.force_present:v1" 2 "gimple" } }
+! { dg-final { scan-tree-dump-times "map.force_present:v2" 2 "gimple" } }
! { dg-do compile }
-! { dg-additional-options "-fmax-errors=100" }
+! { dg-additional-options "-fmax-errors=0" }
subroutine foo (ia1)
integer :: i1, i2, i3
! { dg-error "Array 'ta1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
!$acc end parallel
+!$acc serial reduction (+:ia2)
+! { dg-error "Array 'ia2' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (+:ra1)
+! { dg-error "Array 'ra1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (+:ca1)
+! { dg-error "Array 'ca1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (+:da1)
+! { dg-error "Array 'da1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (.and.:la1)
+! { dg-error "Array 'la1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (+:i3, r1, d1, c1)
+!$acc end serial
+!$acc serial reduction (*:i3, r1, d1, c1)
+!$acc end serial
+!$acc serial reduction (-:i3, r1, d1, c1)
+!$acc end serial
+!$acc serial reduction (.and.:l1)
+!$acc end serial
+!$acc serial reduction (.or.:l1)
+!$acc end serial
+!$acc serial reduction (.eqv.:l1)
+!$acc end serial
+!$acc serial reduction (.neqv.:l1)
+!$acc end serial
+!$acc serial reduction (min:i3, r1, d1)
+!$acc end serial
+!$acc serial reduction (max:i3, r1, d1)
+!$acc end serial
+!$acc serial reduction (iand:i3)
+!$acc end serial
+!$acc serial reduction (ior:i3)
+!$acc end serial
+!$acc serial reduction (ieor:i3)
+!$acc end serial
+!$acc serial reduction (+:/blk/) ! { dg-error "Syntax error" }
+!$acc end serial ! { dg-error "Unexpected" }
+!$acc serial reduction (*:p1) ! { dg-error "POINTER object" }
+!$acc end serial
+!$acc serial reduction (-:aa1)
+! { dg-error "Array 'aa1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (*:ia1) ! { dg-error "Assumed size" }
+! { dg-error "Array 'ia1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (+:l1) ! { dg-error "OMP DECLARE REDUCTION \\+ not found for type LOGICAL" }
+!$acc end serial
+!$acc serial reduction (*:la1) ! { dg-error "OMP DECLARE REDUCTION \\* not found for type LOGICAL" }
+! { dg-error "Array 'la1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (-:a1) ! { dg-error "OMP DECLARE REDUCTION - not found for type CHARACTER" }
+!$acc end serial
+!$acc serial reduction (+:t1) ! { dg-error "OMP DECLARE REDUCTION \\+ not found for type TYPE" }
+!$acc end serial
+!$acc serial reduction (*:ta1) ! { dg-error "OMP DECLARE REDUCTION \\* not found for type TYPE" }
+! { dg-error "Array 'ta1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (.and.:i3) ! { dg-error "OMP DECLARE REDUCTION \\.and\\. not found for type INTEGER" }
+!$acc end serial
+!$acc serial reduction (.or.:ia2) ! { dg-error "OMP DECLARE REDUCTION \\.or\\. not found for type INTEGER" }
+! { dg-error "Array 'ia2' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (.eqv.:r1) ! { dg-error "OMP DECLARE REDUCTION \\.eqv\\. not found for type REAL" }
+!$acc end serial
+!$acc serial reduction (.neqv.:ra1) ! { dg-error "OMP DECLARE REDUCTION \\.neqv\\. not found for type REAL" }
+! { dg-error "Array 'ra1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (.and.:d1) ! { dg-error "OMP DECLARE REDUCTION \\.and\\. not found for type REAL" }
+!$acc end serial
+!$acc serial reduction (.or.:da1) ! { dg-error "OMP DECLARE REDUCTION \\.or\\. not found for type REAL" }
+! { dg-error "Array 'da1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (.eqv.:c1) ! { dg-error "OMP DECLARE REDUCTION \\.eqv\\. not found for type COMPLEX" }
+!$acc end serial
+!$acc serial reduction (.neqv.:ca1) ! { dg-error "OMP DECLARE REDUCTION \\.neqv\\. not found for type COMPLEX" }
+! { dg-error "Array 'ca1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (.and.:a1) ! { dg-error "OMP DECLARE REDUCTION \\.and\\. not found for type CHARACTER" }
+!$acc end serial
+!$acc serial reduction (.or.:t1) ! { dg-error "OMP DECLARE REDUCTION \\.or\\. not found for type TYPE" }
+!$acc end serial
+!$acc serial reduction (.eqv.:ta1) ! { dg-error "OMP DECLARE REDUCTION \\.eqv\\. not found for type TYPE" }
+! { dg-error "Array 'ta1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (min:c1) ! { dg-error "OMP DECLARE REDUCTION min not found for type COMPLEX" }
+!$acc end serial
+!$acc serial reduction (max:ca1) ! { dg-error "OMP DECLARE REDUCTION max not found for type COMPLEX" }
+! { dg-error "Array 'ca1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (max:l1) ! { dg-error "OMP DECLARE REDUCTION max not found for type LOGICAL" }
+!$acc end serial
+!$acc serial reduction (min:la1) ! { dg-error "OMP DECLARE REDUCTION min not found for type LOGICAL" }
+! { dg-error "Array 'la1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (max:a1) ! { dg-error "OMP DECLARE REDUCTION max not found for type CHARACTER" }
+!$acc end serial
+!$acc serial reduction (min:t1) ! { dg-error "OMP DECLARE REDUCTION min not found for type TYPE" }
+!$acc end serial
+!$acc serial reduction (max:ta1) ! { dg-error "OMP DECLARE REDUCTION max not found for type TYPE" }
+! { dg-error "Array 'ta1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (iand:r1) ! { dg-error "OMP DECLARE REDUCTION iand not found for type REAL" }
+!$acc end serial
+!$acc serial reduction (ior:ra1) ! { dg-error "OMP DECLARE REDUCTION ior not found for type REAL" }
+! { dg-error "Array 'ra1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (ieor:d1) ! { dg-error "OMP DECLARE REDUCTION ieor not found for type REAL" }
+!$acc end serial
+!$acc serial reduction (ior:da1) ! { dg-error "OMP DECLARE REDUCTION ior not found for type REAL" }
+! { dg-error "Array 'da1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (iand:c1) ! { dg-error "OMP DECLARE REDUCTION iand not found for type COMPLEX" }
+!$acc end serial
+!$acc serial reduction (ior:ca1) ! { dg-error "OMP DECLARE REDUCTION ior not found for type COMPLEX" }
+! { dg-error "Array 'ca1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (ieor:l1) ! { dg-error "OMP DECLARE REDUCTION ieor not found for type LOGICAL" }
+!$acc end serial
+!$acc serial reduction (iand:la1) ! { dg-error "OMP DECLARE REDUCTION iand not found for type LOGICAL" }
+! { dg-error "Array 'la1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+!$acc serial reduction (ior:a1) ! { dg-error "OMP DECLARE REDUCTION ior not found for type CHARACTER" }
+!$acc end serial
+!$acc serial reduction (ieor:t1) ! { dg-error "OMP DECLARE REDUCTION ieor not found for type TYPE" }
+!$acc end serial
+!$acc serial reduction (iand:ta1) ! { dg-error "OMP DECLARE REDUCTION iand not found for type TYPE" }
+! { dg-error "Array 'ta1' is not permitted in reduction" "" { target "*-*-*" } .-1 }
+!$acc end serial
+
end subroutine
un(i) = ua(i)
END DO
!$acc end parallel
+
+ !$acc serial
+ DO jj = 1, 100
+ un(i) = ua(i)
+ END DO
+ !$acc end serial
+
END SUBROUTINE gwv
END PROGRAM nested_gwv
-! Check valid calls to 'external' OpenACC routines.
+! Check valid calls to 'external' OpenACC routines from OpenACC
+! 'parallel' constructs.
! { dg-additional-options "-fopt-info-optimized-omp" }
--- /dev/null
+! Check valid calls to 'external' OpenACC routines from OpenACC
+! 'serial' constructs.
+
+! { dg-additional-options "-fopt-info-optimized-omp" }
+
+ subroutine sub
+ implicit none
+ integer, parameter :: n = 100
+ integer :: a(n), i, j
+ external :: gangr, workerr, vectorr, seqr
+!$acc routine (gangr) gang
+!$acc routine (workerr) worker
+!$acc routine (vectorr) vector
+!$acc routine (seqr) seq
+
+!
+! Test subroutine calls inside nested loops.
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+!$acc loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+ end do
+!$acc end serial loop
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do i = 1, n
+!$acc loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do j = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+ end do
+!$acc end serial loop
+
+!
+! Test calls to seq routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang vector loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to gang routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do i = 1, n
+ call gangr (a, n) ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ call gangr (a, n) ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to worker routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to vector routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang worker loop parallelism" }
+ do i = 1, n
+ call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+ end subroutine sub
+
+ subroutine func
+ implicit none
+ integer, parameter :: n = 100
+ integer :: a(n), i, j
+ integer, external :: gangf, workerf, vectorf, seqf
+!$acc routine (gangf) gang
+!$acc routine (workerf) worker
+!$acc routine (vectorf) vector
+!$acc routine (seqf) seq
+
+!
+! Test subroutine calls inside nested loops.
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+!$acc loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, n
+ a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+ end do
+!$acc end serial loop
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do i = 1, n
+!$acc loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do j = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+ end do
+!$acc end serial loop
+
+!
+! Test calls to seq routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang vector loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to gang routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do i = 1, n
+ a(i) = gangf (a, n) ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ a(i) = gangf (a, n) ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to worker routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to vector routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang worker loop parallelism" }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+ end subroutine func
-! Check invalid calls to 'external' OpenACC routines.
+! Check invalid calls to 'external' OpenACC routines from OpenACC
+! 'parallel' constructs.
! { dg-additional-options "-fopt-info-optimized-omp" }
--- /dev/null
+! Check invalid calls to 'external' OpenACC routines from OpenACC
+! 'serial' constructs.
+
+! { dg-additional-options "-fopt-info-optimized-omp" }
+
+ subroutine sub
+ implicit none
+ integer, parameter :: n = 100
+ integer :: a(n), i, j
+ external :: gangr, workerr, vectorr, seqr
+! { dg-note "routine 'gangr' declared here" "" { target { ! offloading_enabled } } .-1 }
+! { dg-note "routine 'gangr_' declared here" "" { target offloading_enabled } .-2 }
+! { dg-note "routine 'workerr' declared here" "" { target { ! offloading_enabled } } .-3 }
+! { dg-note "routine 'workerr_' declared here" "" { target offloading_enabled } .-4 }
+! { dg-note "routine 'vectorr' declared here" "" { target { ! offloading_enabled } } .-5 }
+! { dg-note "routine 'vectorr_' declared here" "" { target offloading_enabled } .-6 }
+!TODO See PR101551 for 'offloading_enabled' differences.
+
+!$acc routine (gangr) gang
+!$acc routine (workerr) worker
+!$acc routine (vectorr) vector
+!$acc routine (seqr) seq
+
+!
+! Test subroutine calls inside nested loops.
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+!$acc loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+ end do
+!$acc end serial loop
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do i = 1, n
+!$acc loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do j = 1, n
+ call gangr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+ end do
+!$acc end serial loop
+
+!
+! Test calls to seq routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang vector loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ call seqr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to gang routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do i = 1, n
+ call gangr (a, n) ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ call gangr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ call gangr (a, n) ! { dg-message "optimized: assigned OpenACC gang vector loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ call gangr (a, n) ! { dg-message "optimized: assigned OpenACC gang worker loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ call gangr (a, n) ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to worker routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to vector routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang worker loop parallelism" }
+ do i = 1, n
+ call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+ end subroutine sub
+
+ subroutine func
+ implicit none
+ integer, parameter :: n = 100
+ integer :: a(n), i, j
+ integer, external :: gangf, workerf, vectorf, seqf
+! { dg-note "routine 'gangf' declared here" "" { target { ! offloading_enabled } } .-1 }
+! { dg-note "routine 'gangf_' declared here" "" { target offloading_enabled } .-2 }
+! { dg-note "routine 'workerf' declared here" "" { target { ! offloading_enabled } } .-3 }
+! { dg-note "routine 'workerf_' declared here" "" { target offloading_enabled } .-4 }
+! { dg-note "routine 'vectorf' declared here" "" { target { ! offloading_enabled } } .-5 }
+! { dg-note "routine 'vectorf_' declared here" "" { target offloading_enabled } .-6 }
+!TODO See PR101551 for 'offloading_enabled' differences.
+
+!$acc routine (gangf) gang
+!$acc routine (workerf) worker
+!$acc routine (vectorf) vector
+!$acc routine (seqf) seq
+
+!
+! Test subroutine calls inside nested loops.
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+!$acc loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do j = 1, n
+ a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+ end do
+!$acc end serial loop
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do i = 1, n
+!$acc loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do j = 1, n
+ a(i) = gangf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+ end do
+!$acc end serial loop
+
+!
+! Test calls to seq routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang vector loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ a(i) = seqf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to gang routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ do i = 1, n
+ a(i) = gangf (a, n) ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ a(i) = gangf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ a(i) = gangf (a, n) ! { dg-message "optimized: assigned OpenACC gang vector loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ a(i) = gangf (a, n) ! { dg-message "optimized: assigned OpenACC gang worker loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ a(i) = gangf (a, n) ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to worker routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!
+! Test calls to vector routines
+!
+
+!$acc serial loop ! { dg-message "optimized: assigned OpenACC gang worker loop parallelism" }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+
+!$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+! { dg-note "containing loop here" "" { target *-*-* } .-1 }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 }
+ end do
+!$acc end serial loop
+
+!$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, n
+ a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+!$acc end serial loop
+ end subroutine func
integer :: i
+
call pl_1
+ call sl_1
+
+
!$acc parallel loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
do i = 1, 10
call s_1 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
call s_2_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
end do
!$acc end parallel loop
+
+
+ !$acc serial loop seq ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ do i = 1, 10
+ call s_1 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_1_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_2 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_2_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call g_1 ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ call g_1_nh ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ call w_1 ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ call w_1_nh ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ call v_1 ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ call v_1_nh ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop gang ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ do i = 1, 10
+ call s_1 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_1_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_2 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_2_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call w_1 ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ call w_1_nh ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ call v_1 ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ call v_1_nh ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop worker ! { dg-message "optimized: assigned OpenACC worker loop parallelism" }
+ do i = 1, 10
+ call s_1 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_1_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_2 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_2_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call v_1 ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ call v_1_nh ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop vector ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ do i = 1, 10
+ call s_1 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_1_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_2 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_2_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ end do
+ !$acc end serial loop
+
end program main
integer :: i
+
!$acc parallel loop gang
do i = 1, 10
call g_1 ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
call v_1_nh ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
end do
!$acc end parallel loop
+
+
+ !$acc serial loop gang
+ do i = 1, 10
+ call g_1 ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ call g_1_nh ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop worker
+ do i = 1, 10
+ call g_1 ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ call g_1_nh ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ call w_1 ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ call w_1_nh ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ end do
+ !$acc end serial loop
+
+ !$acc serial loop vector
+ do i = 1, 10
+ call g_1 ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ call g_1_nh ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ call w_1 ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ call w_1_nh ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ call v_1 ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ call v_1_nh ! { dg-error "routine call uses same OpenACC parallelism as containing loop" }
+ end do
+ !$acc end serial loop
+
end program main
call g_1_nh ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
end do
end subroutine pl_1
+
+ subroutine sl_1
+ implicit none
+
+ integer :: i
+
+ !$acc serial loop ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+ ! { dg-warning "region contains gang partitioned code but is not gang partitioned" "" { target *-*-* } .-2 }
+ ! { dg-warning "region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-3 }
+ ! { dg-warning "region contains vector partitioned code but is not vector partitioned" "" { target *-*-* } .-4 }
+ do i = 1, 3
+ call s_1 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_1_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_2 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call s_2_nh ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ call v_1 ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ call v_1_nh ! { dg-message "optimized: assigned OpenACC vector loop parallelism" }
+ call w_1 ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ call w_1_nh ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ call g_1 ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ call g_1_nh ! { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" }
+ end do
+ end subroutine sl_1
+
end module routine_module_mod_1
--- /dev/null
+! { dg-additional-options "-fdump-tree-original" }
+
+! test for tree-dump-original and spaces-commas
+
+! { dg-additional-options -Wuninitialized }
+
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
+program test
+ implicit none
+ integer :: q, i, j, k, m, n, o, p, r, s, t, u, v, w
+ ! { dg-note {'i' was declared here} {} { xfail *-*-* } .-1 }
+ logical :: l = .true.
+
+ !$acc serial if(l) async &
+ !$acc self &
+ !$acc reduction(max:q), copy(i), copyin(j), copyout(k), create(m) &
+ !$acc no_create(n) &
+ !$acc present(o), pcopy(p), pcopyin(r), pcopyout(s), pcreate(t) &
+ !$acc deviceptr(u), private(v), firstprivate(w)
+ ! { dg-warning {'i' is used uninitialized} {} { xfail *-*-* } .-1 }
+ !$acc end serial
+
+end program test
+
+! { dg-final { scan-tree-dump-times "pragma acc serial" 1 "original" } }
+
+! { dg-final { scan-tree-dump-times "if" 1 "original" } }
+! { dg-final { scan-tree-dump-times "async" 1 "original" } }
+! { dg-final { scan-tree-dump-times "self\\(1\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "reduction\\(max:q\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "map\\(tofrom:i\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "map\\(to:j\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "map\\(from:k\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "map\\(alloc:m\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "map\\(no_alloc:n\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "map\\(force_present:o\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "map\\(tofrom:p\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "map\\(to:r\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "map\\(from:s\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "map\\(alloc:t\\)" 1 "original" } }
+
+! { dg-final { scan-tree-dump-times "map\\(force_deviceptr:u\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "private\\(v\\)" 1 "original" } }
!$acc kernels async("1") ! { dg-error "scalar INTEGER expression" }
!$acc end kernels
+ !$acc serial async
+ !$acc end serial
+
+ !$acc serial async(3)
+ !$acc end serial
+
+ !$acc serial async(i)
+ !$acc end serial
+
+ !$acc serial async(i+1)
+ !$acc end serial
+
+ !$acc serial async(-1)
+ !$acc end serial
+
+ !$acc serial async(0)
+ !$acc end serial
+
+ !$acc serial async() ! { dg-error "Invalid character in name" }
+
+ !$acc serial async(1.5) ! { dg-error "scalar INTEGER expression" }
+ !$acc end serial
+
+ !$acc serial async(.true.) ! { dg-error "scalar INTEGER expression" }
+ !$acc end serial
+
+ !$acc serial async("1") ! { dg-error "scalar INTEGER expression" }
+ !$acc end serial
+
!$acc parallel num_gangs ! { dg-error "Expected '\\(' after 'num_gangs'" }
!$acc parallel copy (c(2:)) ! { dg-warning "Lower array reference" }
!$acc end parallel
+
+
+ !$acc serial copy(a(1:5))
+ !$acc end serial
+ !$acc serial copy(a(1 + 0 : 5 + 2))
+ !$acc end serial
+ !$acc serial copy(a(:3))
+ !$acc end serial
+ !$acc serial copy(a(3:))
+ !$acc end serial
+ !$acc serial copy(a(:))
+ !$acc end serial
+ !$acc serial copy(a(2:3,2:3))
+ ! { dg-error "Rank mismatch" "" { target *-*-* } .-1 }
+ ! { dg-error "'a' in MAP clause" "" { target *-*-* } .-2 }
+ !$acc end serial
+ !$acc serial copy (a(:11)) ! { dg-warning "Upper array reference" }
+ !$acc end serial
+ !$acc serial copy (a(i:))
+ !$acc end serial
+
+ !$acc serial copy (a(:b))
+ ! { dg-error "Array index" "" { target *-*-* } .-1 }
+ ! { dg-error "'a' in MAP clause" "" { target *-*-* } .-2 }
+ !$acc end serial
+
+ !$acc serial copy (b(1:3,2:4)) ! { dg-error "Array is not contiguous" }
+ !$acc end serial
+ !$acc serial copy (b(2:3))
+ ! { dg-error "Rank mismatch" "" { target *-*-* } .-1 }
+ ! { dg-error "'b' in MAP clause" "" { target *-*-* } .-2 }
+ !$acc end serial
+ !$acc serial copy (b(1:, 4:6))
+ !$acc end serial
+
+ !$acc serial copy (c(2:)) ! { dg-warning "Lower array reference" }
+ !$acc end serial
+
end program test
! { dg-do compile }
! { dg-additional-options "-Wuninitialized" }
-subroutine test
+subroutine test_parallel
INTEGER :: i
!$acc parallel
i = 1
!$acc end parallel
-end subroutine test
+end subroutine test_parallel
-subroutine test2
+subroutine test_serial
+ INTEGER :: i
+
+ !$acc serial
+ i = 1
+ !$acc end serial
+end subroutine test_serial
+
+
+subroutine test2_parallel
INTEGER :: i
! { dg-note {'i' was declared here} {} { target *-*-* } .-1 }
!$acc parallel firstprivate (i) ! { dg-warning "is used uninitialized" }
i = 1
!$acc end parallel
-end subroutine test2
+end subroutine test2_parallel
+
+subroutine test2_serial
+ INTEGER :: i
+ ! { dg-note {'i' was declared here} {} { target *-*-* } .-1 }
+
+ !$acc serial firstprivate (i) ! { dg-warning "is used uninitialized" }
+ i = 1
+ !$acc end serial
+end subroutine test2_serial
program test
implicit none
- logical :: b, b2, b3, b4
+ logical :: b, b2, bs, b3, b4
! { dg-note {'b' was declared here} {} { target *-*-* } .-1 }
! { dg-note {'b2' was declared here} {} { target *-*-* } .-2 }
- ! { dg-note {'b3' was declared here} {} { target *-*-* } .-3 }
- ! { dg-note {'b4' was declared here} {} { target *-*-* } .-4 }
+ ! { dg-note {'bs' was declared here} {} { target *-*-* } .-3 }
+ ! { dg-note {'b3' was declared here} {} { target *-*-* } .-4 }
+ ! { dg-note {'b4' was declared here} {} { target *-*-* } .-5 }
integer :: data, data2
!$acc parallel if(b) ! { dg-warning "is used uninitialized" }
!$acc kernels if(b2) ! { dg-warning "is used uninitialized" }
!$acc end kernels
+ !$acc serial if(bs) ! { dg-warning "is used uninitialized" }
+ !$acc end serial
+
!$acc data if(b3) ! { dg-warning "is used uninitialized" }
!$acc end data
do b = 1, 10
end do
!$acc end parallel loop ! { dg-error "Unexpected ..ACC END PARALLEL LOOP statement" }
+
+ !$acc serial loop if_present ! { dg-error "Expected '\\(' after 'if'" }
+ do b = 1, 10
+ end do
+ !$acc end serial loop ! { dg-error "Unexpected ..ACC END SERIAL LOOP statement" }
+
end subroutine t2