From fda0b0eb4f744f012f21c6976c2e42df87c313bb Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Tue, 1 Mar 2022 14:57:38 +0100
Subject: [PATCH] Update 'c-c++-common/goacc/classify-*',
'gfortran.dg/goacc/classify-*'
... to use 'dg-line', simplifying later changes. Also some minor miscellaneous
diagnostics scanning maintenance.
gcc/testsuite/
* c-c++-common/goacc/classify-kernels-parloops.c: Update.
* c-c++-common/goacc/classify-kernels-unparallelized-parloops.c:
Likewise.
* c-c++-common/goacc/classify-kernels-unparallelized.c: Likewise.
* c-c++-common/goacc/classify-kernels.c: Likewise.
* c-c++-common/goacc/classify-parallel.c: Likewise.
* c-c++-common/goacc/classify-routine-nohost.c: Likewise.
* c-c++-common/goacc/classify-routine.c: Likewise.
* c-c++-common/goacc/classify-serial.c: Likewise.
* gfortran.dg/goacc/classify-kernels-parloops.f95: Likewise.
* gfortran.dg/goacc/classify-kernels-unparallelized-parloops.f95:
Likewise.
* gfortran.dg/goacc/classify-kernels-unparallelized.f95: Likewise.
* gfortran.dg/goacc/classify-kernels.f95: Likewise.
* gfortran.dg/goacc/classify-parallel.f95: Likewise.
* gfortran.dg/goacc/classify-routine-nohost.f95: Likewise.
* gfortran.dg/goacc/classify-routine.f95: Likewise.
* gfortran.dg/goacc/classify-serial.f95: Likewise.
---
.../c-c++-common/goacc/classify-kernels-parloops.c | 3 ++-
.../goacc/classify-kernels-unparallelized-parloops.c | 3 ++-
.../c-c++-common/goacc/classify-kernels-unparallelized.c | 3 ++-
gcc/testsuite/c-c++-common/goacc/classify-kernels.c | 3 ++-
gcc/testsuite/c-c++-common/goacc/classify-parallel.c | 3 ++-
.../c-c++-common/goacc/classify-routine-nohost.c | 3 ++-
gcc/testsuite/c-c++-common/goacc/classify-routine.c | 3 ++-
gcc/testsuite/c-c++-common/goacc/classify-serial.c | 9 +++++----
.../gfortran.dg/goacc/classify-kernels-parloops.f95 | 3 ++-
.../goacc/classify-kernels-unparallelized-parloops.f95 | 3 ++-
.../goacc/classify-kernels-unparallelized.f95 | 3 ++-
gcc/testsuite/gfortran.dg/goacc/classify-kernels.f95 | 3 ++-
gcc/testsuite/gfortran.dg/goacc/classify-parallel.f95 | 3 ++-
.../gfortran.dg/goacc/classify-routine-nohost.f95 | 3 ++-
gcc/testsuite/gfortran.dg/goacc/classify-routine.f95 | 3 ++-
gcc/testsuite/gfortran.dg/goacc/classify-serial.f95 | 9 +++++----
16 files changed, 38 insertions(+), 22 deletions(-)
@@ -20,7 +20,8 @@ extern unsigned int *__restrict c;
void KERNELS ()
{
-#pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
+#pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-line l_compute1 } */
+ /* { dg-optimized {assigned OpenACC gang loop parallelism} {} { target *-*-* } l_compute1 } */
for (unsigned int i = 0; i < N; i++)
c[i] = a[i] + b[i];
}
@@ -24,7 +24,8 @@ extern unsigned int f (unsigned int);
void KERNELS ()
{
-#pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-line l_compute1 } */
+ /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute1 } */
for (unsigned int i = 0; i < N; i++)
c[i] = a[f (i)] + b[f (i)];
}
@@ -24,7 +24,8 @@ extern unsigned int f (unsigned int);
void KERNELS ()
{
-#pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-line l_compute1 } */
+ /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute1 } */
/* { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} {} { target *-*-* } .+1 } */
for (unsigned int i = 0; i < N; i++)
c[i] = a[f (i)] + b[f (i)];
@@ -20,7 +20,8 @@ extern unsigned int *__restrict c;
void KERNELS ()
{
-#pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
+#pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-line l_compute1 } */
+ /* { dg-optimized {assigned OpenACC gang loop parallelism} {} { target *-*-* } l_compute1 } */
/* { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} {} { target *-*-* } .+1 } */
for (unsigned int i = 0; i < N; i++)
c[i] = a[i] + b[i];
@@ -17,7 +17,8 @@ extern unsigned int *__restrict c;
void PARALLEL ()
{
-#pragma acc parallel loop copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
+#pragma acc parallel loop copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-line l_compute_loop_i1 } */
+ /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_compute_loop_i1 } */
for (unsigned int i = 0; i < N; i++)
c[i] = a[i] + b[i];
}
@@ -19,7 +19,8 @@ extern unsigned int *__restrict c;
#pragma acc routine nohost worker
void ROUTINE ()
{
-#pragma acc loop /* { dg-bogus "assigned OpenACC .* loop parallelism" } */
+#pragma acc loop /* { dg-line l_loop_i1 } */
+ /* { dg-bogus {optimized: assigned OpenACC [^\n\r]+ loop parallelism} {} { target *-*-* } l_loop_i1 } */
for (unsigned int i = 0; i < N; i++)
c[i] = a[i] + b[i];
}
@@ -19,7 +19,8 @@ extern unsigned int *__restrict c;
#pragma acc routine worker
void ROUTINE ()
{
-#pragma acc loop /* { dg-message "optimized: assigned OpenACC worker vector loop parallelism" } */
+#pragma acc loop /* { dg-line l_loop_i1 } */
+ /* { dg-optimized {assigned OpenACC worker vector loop parallelism} {} { target *-*-* } l_loop_i1 } */
for (unsigned int i = 0; i < N; i++)
c[i] = a[i] + b[i];
}
@@ -17,12 +17,13 @@ extern unsigned int *__restrict c;
void SERIAL ()
{
-#pragma acc serial loop copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
- /* { dg-bogus "warning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } .-1 }
- { dg-bogus "warning: region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 }
- { dg-bogus "warning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } .-3 }
+#pragma acc serial loop copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-line l_compute_loop_i1 } */
+ /* { dg-bogus "warning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } l_compute_loop_i1 }
+ { dg-bogus "warning: region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } l_compute_loop_i1 }
+ { dg-bogus "warning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } l_compute_loop_i1 }
TODO Should we really diagnose this if the user explicitly requested 'serial'?
TODO Should we instead diagnose ('-Wextra' category?) that the user may enable use of parallelism if replacing 'serial' with 'parallel', if applicable? */
+ /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_compute_loop_i1 } */
for (unsigned int i = 0; i < N; i++)
c[i] = a[i] + b[i];
}
@@ -20,7 +20,8 @@ program main
call setup(a, b)
- !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-line l_compute1 }
+ ! { dg-optimized {assigned OpenACC gang loop parallelism} {} { target *-*-* } l_compute1 }
do i = 0, n - 1
c(i) = a(i) + b(i)
end do
@@ -24,7 +24,8 @@ program main
call setup(a, b)
- !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-line l_compute1 }
+ ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute1 }
do i = 0, n - 1
c(i) = a(f (i)) + b(f (i))
end do
@@ -24,7 +24,8 @@ program main
call setup(a, b)
- !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
+ !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-line l_compute1 }
+ ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute1 }
! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} {} { target *-*-* } .+1 }
do i = 0, n - 1
c(i) = a(f (i)) + b(f (i))
@@ -20,7 +20,8 @@ program main
call setup(a, b)
- !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
+ !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-line l_compute1 }
+ ! { dg-optimized {assigned OpenACC gang loop parallelism} {} { target *-*-* } l_compute1 }
! { dg-note {beginning 'parloops' part in OpenACC 'kernels' region} {} { target *-*-* } .+1 }
do i = 0, n - 1
c(i) = a(i) + b(i)
@@ -17,7 +17,8 @@ program main
call setup(a, b)
- !$acc parallel loop copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-message "optimized: assigned OpenACC gang vector loop parallelism" }
+ !$acc parallel loop copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-line l_compute_loop_i1 }
+ ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_compute_loop_i1 }
do i = 0, n - 1
c(i) = a(i) + b(i)
end do
@@ -17,7 +17,8 @@ subroutine ROUTINE
call setup(a, b)
- !$acc loop ! { dg-bogus "assigned OpenACC .* loop parallelism" }
+ !$acc loop ! { dg-line l_loop_i1 }
+ ! { dg-bogus {optimized: assigned OpenACC [^\n\r]+ loop parallelism} {} { target *-*-* } l_loop_i1 }
do i = 0, n - 1
c(i) = a(i) + b(i)
end do
@@ -17,7 +17,8 @@ subroutine ROUTINE
call setup(a, b)
- !$acc loop ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" }
+ !$acc loop ! { dg-line l_loop_i1 }
+ ! { dg-optimized {assigned OpenACC worker vector loop parallelism} {} { target *-*-* } l_loop_i1 }
do i = 0, n - 1
c(i) = a(i) + b(i)
end do
@@ -17,10 +17,11 @@ program main
call setup(a, b)
- !$acc serial loop copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-message "optimized: assigned OpenACC gang vector loop parallelism" }
- ! { dg-bogus "\[Ww\]arning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } .-1 }
- ! { dg-bogus "\[Ww\]arning: region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 }
- ! { dg-bogus "\[Ww\]arning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } .-3 }
+ !$acc serial loop copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-line l_compute_loop_i1 }
+ ! { dg-bogus "\[Ww\]arning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } l_compute_loop_i1 }
+ ! { dg-bogus "\[Ww\]arning: region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } l_compute_loop_i1 }
+ ! { dg-bogus "\[Ww\]arning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } l_compute_loop_i1 }
+ ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_compute_loop_i1 }
do i = 0, n - 1
c(i) = a(i) + b(i)
end do
--
2.34.1