[1/4] openmp: Fix loop transformation tests

Message ID 20230728130433.2377366-2-frederik@codesourcery.com
State New
Headers
Series openmp: loop transformation fixes |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 warning Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-arm warning Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_check--master-arm warning Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 warning Patch failed to apply

Commit Message

Frederik Harwath July 28, 2023, 1:04 p.m. UTC
  libgomp/ChangeLog:

        * testsuite/libgomp.fortran/loop-transforms/tile-2.f90: Add reduction clause.
        * testsuite/libgomp.fortran/loop-transforms/unroll-1.f90: Initialize var.
        * testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90: Add reduction
        and initialization.
---
 libgomp/testsuite/libgomp.fortran/loop-transforms/tile-2.f90   | 2 +-
 libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90 | 2 ++
 .../libgomp.fortran/loop-transforms/unroll-simd-1.f90          | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

--
2.36.1

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
  

Patch

diff --git a/libgomp/testsuite/libgomp.fortran/loop-transforms/tile-2.f90 b/libgomp/testsuite/libgomp.fortran/loop-transforms/tile-2.f90
index 6aedbf4724f..a7cb5e7635d 100644
--- a/libgomp/testsuite/libgomp.fortran/loop-transforms/tile-2.f90
+++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/tile-2.f90
@@ -69,7 +69,7 @@  module test_functions
     integer :: i,j

     sum = 0
-    !$omp parallel do collapse(2)
+    !$omp parallel do collapse(2) reduction(+:sum)
     !$omp tile sizes(6,10)
     do i = 1,10,3
        do j = 1,10,3
diff --git a/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90 b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90
index f07aab898fa..b91ea275577 100644
--- a/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90
@@ -8,6 +8,7 @@  module test_functions

     integer :: i,j

+    sum = 0
     !$omp do
     do i = 1,10,3
        !$omp unroll full
@@ -22,6 +23,7 @@  module test_functions

     integer :: i,j

+    sum = 0
     !$omp parallel do reduction(+:sum)
     !$omp unroll partial(2)
     do i = 1,10,3
diff --git a/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90 b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90
index 5fb64ddd6fd..7a43458f0dd 100644
--- a/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90
@@ -9,7 +9,8 @@  module test_functions

     integer :: i,j

-    !$omp simd
+    sum = 0
+    !$omp simd reduction(+:sum)
     do i = 1,10,3
        !$omp unroll full
        do j = 1,10,3