From 1cb2d1d5ce178cb68f0bd475299d2e0b25a4a756 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Wed, 9 Dec 2020 10:42:49 +0100 Subject: [PATCH] gfortran.dg/gomp/reduction4.f90: Fix testcase Fix to 'omp scan' commit 005cff4e2ecbd5c4e2ef978fe4842fa3c8c79f47 gcc/testsuite/ChangeLog: * gfortran.dg/gomp/reduction4.f90: Update scan-trees, add lost testcase; move test with FE error to ... * gfortran.dg/gomp/reduction5.f90: ... here. --- gcc/testsuite/gfortran.dg/gomp/reduction4.f90 | 23 ++++++------------- gcc/testsuite/gfortran.dg/gomp/reduction5.f90 | 14 +++++++++++ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/gcc/testsuite/gfortran.dg/gomp/reduction4.f90 b/gcc/testsuite/gfortran.dg/gomp/reduction4.f90 index 812be323b2e..2e8aaa2d54c 100644 --- a/gcc/testsuite/gfortran.dg/gomp/reduction4.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/reduction4.f90 @@ -28,11 +28,6 @@ do i=1,10 end do !$omp end parallel -!$omp parallel reduction(inscan,+:a) ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" } -do i=1,10 - a = a + 1 -end do -!$omp end parallel ! ------------ simd ------------ !$omp simd reduction(+:a) @@ -45,6 +40,11 @@ do i=1,10 a = a + 1 end do +!$omp simd reduction(task,+:a) ! { dg-error "invalid 'task' reduction modifier on construct other than 'parallel', 'do' or 'sections'" } +do i=1,10 + a = a + 1 +end do + ! ------------ do ------------ !$omp parallel !$omp do reduction(+:a) @@ -89,13 +89,6 @@ end do !$omp end sections !$omp end parallel -!$omp parallel -!$omp sections reduction(inscan,+:a) ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" } - !$omp section - a = a + 1 -!$omp end sections -!$omp end parallel - ! ------------ task ------------ !$omp task in_reduction(+:a) a = a + 1 @@ -136,13 +129,11 @@ end ! { dg-final { scan-tree-dump-times "#pragma omp for reduction\\(\\\+:a\\)" 2 "original" } } ! { dg-final { scan-tree-dump-times "#pragma omp for reduction\\(task,\\\+:a\\)" 1 "original" } } -! { dg-final { scan-tree-dump-times "#pragma omp parallel\[\n\r\]" 7 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp parallel\[\n\r\]" 6 "original" } } ! { dg-final { scan-tree-dump-times "#pragma omp parallel private\\(i\\) reduction\\(\\\+:a\\)" 2 "original" } } -! { dg-final { scan-tree-dump-times "#pragma omp parallel private\\(i\\) reduction\\(inscan,\\\+:a\\)" 1 "original" } } ! { dg-final { scan-tree-dump-times "#pragma omp parallel private\\(i\\) reduction\\(task,\\\+:a\\)" 1 "original" } } -! { dg-final { scan-tree-dump-times "#pragma omp section\[\n\r\]" 4 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp section\[\n\r\]" 3 "original" } } ! { dg-final { scan-tree-dump-times "#pragma omp sections reduction\\(\\\+:a\\)" 2 "original" } } -! { dg-final { scan-tree-dump-times "#pragma omp sections reduction\\(inscan,\\\+:a\\)" 1 "original" } } ! { dg-final { scan-tree-dump-times "#pragma omp sections reduction\\(task,\\\+:a\\)" 1 "original" } } ! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) reduction\\(\\\+:a\\)" 2 "original" } } ! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) reduction\\(task,\\\+:a\\)" 1 "original" } } diff --git a/gcc/testsuite/gfortran.dg/gomp/reduction5.f90 b/gcc/testsuite/gfortran.dg/gomp/reduction5.f90 index bfb847e9933..032703d3b81 100644 --- a/gcc/testsuite/gfortran.dg/gomp/reduction5.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/reduction5.f90 @@ -42,4 +42,18 @@ end do a = a + 1 !$omp end teams +!$omp parallel reduction(inscan,+:a) ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" } +do i=1,10 + a = a + 1 +end do +!$omp end parallel + +!$omp parallel +!$omp sections reduction(inscan,+:a) ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" } + !$omp section + a = a + 1 +!$omp end sections +!$omp end parallel + + end -- 2.30.2