[COMMITTED] OpenMP/Fortran: Fix map-subarray testcases [PR120505]

Paul-Antoine Arras <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <[email protected]>
As pointed out by Thomas, the patchset for PR120505 had two testcase 
failures on some configs.

Here is the fix, committed as an obvious followup to my own previous 
patches.
-- 
PA
0001-OpenMP-Fortran-Fix-map-subarray-testcases-PR120505.patch (text/x-patch, 3 KB)
From 7cbdc80a4afc8a34326c0fdd7742c92388d2e87d Mon Sep 17 00:00:00 2001
From: Paul-Antoine Arras <[email protected]>
Date: Mon, 23 Feb 2026 18:55:16 +0100
Subject: [PATCH] OpenMP/Fortran: Fix map-subarray testcases [PR120505]

The fix for PR120505 introduced two test failures on some configurations.

This patch update the scan dump pattern in map-subarray-4.f90 to allow for
differing pointer sizes, and disable map-subarray-16.f90 when no offload device
is available.

	PR fortran/120505

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/map-subarray-16.f90: Enable test only for
	offload device.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/map-subarray-4.f90: Update scan dumps for -m32.
---
 gcc/testsuite/gfortran.dg/gomp/map-subarray-4.f90     | 4 ++--
 libgomp/testsuite/libgomp.fortran/map-subarray-16.f90 | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gfortran.dg/gomp/map-subarray-4.f90 b/gcc/testsuite/gfortran.dg/gomp/map-subarray-4.f90
index 31db184733b..848953fd6b1 100644
--- a/gcc/testsuite/gfortran.dg/gomp/map-subarray-4.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/map-subarray-4.f90
@@ -25,10 +25,10 @@ var%tiles(1)%den2 = reshape([11,22,33,44],[2,2])
 
 !$omp target enter data map(var%tiles(1)%den2, var%tiles(1)%den1)
 
-! { dg-final { scan-tree-dump { map\(struct_unord:MEM <struct t\[0:\]> \[\(struct t\[0:\] \*\)_[0-9]+\] \[len: 2\]\) map\(to:MEM <struct t\[0:\]> \[\(struct t\[0:\] \*\)_[0-9]+\]\[_[0-9]+\]\.den1 \[pointer set, len: 88\]\) map\(to:MEM <struct t\[0:\]> \[\(struct t\[0:\] \*\)_[0-9]+\]\[_[0-9]+\]\.den2 \[pointer set, len: 88\]\) } "gimple" } }
+! { dg-final { scan-tree-dump { map\(struct_unord:MEM <struct t\[0:\]> \[\(struct t\[0:\] \*\)_[0-9]+\] \[len: 2\]\) map\(to:MEM <struct t\[0:\]> \[\(struct t\[0:\] \*\)_[0-9]+\]\[_[0-9]+\]\.den[12] \[pointer set, len: (?:48|88)]\) map\(to:MEM <struct t\[0:\]> \[\(struct t\[0:\] \*\)_[0-9]+\]\[_[0-9]+\]\.den[12] \[pointer set, len: (?:48|88)\]\) } "gimple" } }
 
 !$omp target exit data map(var%tiles(1)%den2, var%tiles(1)%den1)
 
-! { dg-final { scan-tree-dump { map\(release:MEM <struct t\[0:\]> \[\(struct t\[0:\] \*\)_[0-9]+\]\[_[0-9]+\]\.den1 \[pointer set, len: 88\]\) map\(release:MEM <struct t\[0:\]> \[\(struct t\[0:\] \*\)_[0-9]+\]\[_[0-9]+\]\.den2 \[pointer set, len: 88\]\) } "gimple" } }
+! { dg-final { scan-tree-dump { map\(release:MEM <struct t\[0:\]> \[\(struct t\[0:\] \*\)_[0-9]+\]\[_[0-9]+\]\.den[12] \[pointer set, len: (?:48|88)\]\) map\(release:MEM <struct t\[0:\]> \[\(struct t\[0:\] \*\)_[0-9]+\]\[_[0-9]+\]\.den[12] \[pointer set, len: (?:48|88)\]\) } "gimple" } }
 
 end
diff --git a/libgomp/testsuite/libgomp.fortran/map-subarray-16.f90 b/libgomp/testsuite/libgomp.fortran/map-subarray-16.f90
index bbf452e34b8..4d78561796c 100644
--- a/libgomp/testsuite/libgomp.fortran/map-subarray-16.f90
+++ b/libgomp/testsuite/libgomp.fortran/map-subarray-16.f90
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target { offload_device } } }
 ! { dg-shouldfail "PR124178 TODO" }
 
 ! PR fortran/120505
-- 
2.51.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.