aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorFrederik Harwath <frederik@codesourcery.com>2019-12-10 16:12:58 +0000
committerFrederik Harwath <frederik@gcc.gnu.org>2019-12-10 16:12:58 +0000
commitd0d0ba20f2345023e9cec2419c9fb9e6cc7098c6 (patch)
tree7b20a105f29d9584179a0a6625d1524aaea148a1 /gcc
parent64c5157f6dcf3ed4595d521ac6b75f595a82e29e (diff)
downloadgcc-d0d0ba20f2345023e9cec2419c9fb9e6cc7098c6.zip
gcc-d0d0ba20f2345023e9cec2419c9fb9e6cc7098c6.tar.gz
gcc-d0d0ba20f2345023e9cec2419c9fb9e6cc7098c6.tar.bz2
Add tests to verify OpenACC clause locations
Check that the column information for OpenACC clauses is communicated correctly to the middle-end, in particular by the Fortran front-end (cf. PR 92793). 2019-12-10 Frederik Harwath <frederik@codesourcery.com> gcc/testsuite/ * c-c++-common/goacc/clause-locations.c: New test. * gfortran.dg/goacc/clause-locations.f90: New test. From-SVN: r279169
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/c-c++-common/goacc/clause-locations.c17
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/clause-locations.f9018
3 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 389fb25..e2454a6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-10 Frederik Harwath <frederik@codesourcery.com>
+
+ * c-c++-common/goacc/clause-locations.c: New test.
+ * gfortran.dg/goacc/clause-locations.f90: New test.
+
2019-12-10 Richard Sandiford <richard.sandiford@arm.com>
* gcc.target/aarch64/sve/acle/general/debug_4.c: New test.
diff --git a/gcc/testsuite/c-c++-common/goacc/clause-locations.c b/gcc/testsuite/c-c++-common/goacc/clause-locations.c
new file mode 100644
index 0000000..51184e3
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/clause-locations.c
@@ -0,0 +1,17 @@
+/* Verify that the location information for clauses is correct. */
+
+void
+check_clause_columns() {
+ int i, j, sum, diff;
+
+ #pragma acc parallel
+ {
+ #pragma acc loop reduction(+:sum)
+ for (i = 1; i <= 10; i++)
+ {
+ #pragma acc loop reduction(-:diff) reduction(-:sum) /* { dg-warning "53: conflicting reduction operations for .sum." } */
+ for (j = 1; j <= 10; j++)
+ sum = 1;
+ }
+ }
+}
diff --git a/gcc/testsuite/gfortran.dg/goacc/clause-locations.f90 b/gcc/testsuite/gfortran.dg/goacc/clause-locations.f90
new file mode 100644
index 0000000..29798d3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/clause-locations.f90
@@ -0,0 +1,18 @@
+! Verify that the location information for clauses is correct.
+! See also PR 92793.
+
+subroutine check_clause_columns ()
+ implicit none (type, external)
+ integer :: i, j, sum, diff
+
+ !$acc parallel
+ !$acc loop reduction(+:sum)
+ do i = 1, 10
+ !$acc loop reduction(-:diff) reduction(-:sum) ! { dg-warning "47: conflicting reduction operations for .sum." }
+ do j = 1, 10
+ sum = 1
+ end do
+ end do
+ !$acc end parallel
+end subroutine check_clause_columns
+