public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] OpenMP: Fix new lvalue-parsing map/to/from tests for 32-bit targets
@ 2024-01-10 13:03 Julian Brown
  0 siblings, 0 replies; only message in thread
From: Julian Brown @ 2024-01-10 13:03 UTC (permalink / raw)
  To: gcc-patches

This patch fixes several tests introduced by the commit
r14-7033-g1413af02d62182 for 32-bit targets.

I will commit as obvious.

2024-01-10  Julian Brown  <julian@codesourcery.com>

gcc/testsuite/
	* g++.dg/gomp/array-section-1.C: Fix scan output for 32-bit target.
	* g++.dg/gomp/array-section-2.C: Likewise.
	* g++.dg/gomp/bad-array-section-4.C: Adjust error output for 32-bit
	target.
---
 gcc/testsuite/g++.dg/gomp/array-section-1.C     | 8 ++++----
 gcc/testsuite/g++.dg/gomp/array-section-2.C     | 8 ++++----
 gcc/testsuite/g++.dg/gomp/bad-array-section-4.C | 2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/gcc/testsuite/g++.dg/gomp/array-section-1.C b/gcc/testsuite/g++.dg/gomp/array-section-1.C
index 023706b15c5..562475ab80e 100644
--- a/gcc/testsuite/g++.dg/gomp/array-section-1.C
+++ b/gcc/testsuite/g++.dg/gomp/array-section-1.C
@@ -8,10 +8,10 @@ void foo()
 {
   int arr1[40];
 #pragma omp target map(arr1[x ? C : D])
-// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] \[len: [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \(long int\) &arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] - \(long int\) &arr1\]\)} "original" } }
+// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] \[len: [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] - \((?:long )?int\) &arr1\]\)} "original" } }
   { }
 #pragma omp target map(arr1[x ? C : D : D])
-// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] \[len: [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \(long int\) &arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] - \(long int\) &arr1\]\)} "original" } }
+// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] \[len: [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] - \((?:long )?int\) &arr1\]\)} "original" } }
   { }
 #pragma omp target map(arr1[1 : x ? C : D])
 // { dg-final { scan-tree-dump {map\(tofrom:arr1\[1\] \[len: x != 0 \? [0-9]+ : [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: [0-9]+\]\)} "original" } }
@@ -22,10 +22,10 @@ int main()
 {
   int arr1[40];
 #pragma omp target map(arr1[x ? 3 : 5])
-// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] \[len: [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \(long int\) &arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] - \(long int\) &arr1\]\)} "original" } }
+// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] \[len: [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] - \((?:long )?int\) &arr1\]\)} "original" } }
   { }
 #pragma omp target map(arr1[x ? 3 : 5 : 5])
-// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] \[len: [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \(long int\) &arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] - \(long int\) &arr1\]\)} "original" } }
+// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] \[len: [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x != 0 \? 3 : 5>\] - \((?:long )?int\) &arr1\]\)} "original" } }
   { }
 #pragma omp target map(arr1[1 : x ? 3 : 5])
 // { dg-final { scan-tree-dump {map\(tofrom:arr1\[1\] [len: x != 0 ? [0-9]+ : [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: [0-9]+\]\)} "original" } }
diff --git a/gcc/testsuite/g++.dg/gomp/array-section-2.C b/gcc/testsuite/g++.dg/gomp/array-section-2.C
index 072108d1f89..e2be9791e81 100644
--- a/gcc/testsuite/g++.dg/gomp/array-section-2.C
+++ b/gcc/testsuite/g++.dg/gomp/array-section-2.C
@@ -16,10 +16,10 @@ int C::foo()
   /* There is a parsing ambiguity here without the space.  We don't try to
      resolve that automatically (though maybe we could, in theory).  */
 #pragma omp target map(arr1[::x: ::y])
-// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \(long int\) &arr1\[SAVE_EXPR <x>\] - \(long int\) &arr1\]\)} "original" } }
+// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } }
   { }
 #pragma omp target map(arr1[::x:])
-// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(40 - \(sizetype\) SAVE_EXPR <x>\) \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \(long int\) &arr1\[SAVE_EXPR <x>\] - \(long int\) &arr1\]\)} "original" } }
+// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(40 - \(sizetype\) SAVE_EXPR <x>\) \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } }
   { }
 #pragma omp target map(arr1[: ::y])
 // { dg-final { scan-tree-dump {map\(tofrom:arr1\[0\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: 0\]\)} "original" } }
@@ -40,10 +40,10 @@ void Ct<T>::foo()
 {
   int arr1[40];
 #pragma omp target map(arr1[::x: ::y])
-// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \(long int\) &arr1\[SAVE_EXPR <x>\] - \(long int\) &arr1\]\)} "original" } }
+// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } }
   { }
 #pragma omp target map(arr1[::x:])
-// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(40 - \(sizetype\) SAVE_EXPR <x>\) \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \(long int\) &arr1\[SAVE_EXPR <x>\] - \(long int\) &arr1\]\)} "original" } }
+// { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(40 - \(sizetype\) SAVE_EXPR <x>\) \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } }
   { }
 #pragma omp target map(arr1[: ::y])
 // { dg-final { scan-tree-dump {map\(tofrom:arr1\[0\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: 0\]\)} "original" } }
diff --git a/gcc/testsuite/g++.dg/gomp/bad-array-section-4.C b/gcc/testsuite/g++.dg/gomp/bad-array-section-4.C
index 707c2c31cb2..5d9f056bf7c 100644
--- a/gcc/testsuite/g++.dg/gomp/bad-array-section-4.C
+++ b/gcc/testsuite/g++.dg/gomp/bad-array-section-4.C
@@ -34,7 +34,7 @@ int main()
   // Reject array section in compound initialiser.
 #pragma omp target map( (struct S) { .ptr = (int *) arr[5:5] } )
 // { dg-error {expected '\]' before ':' token} "" { target *-*-* } .-1 }
-// { dg-warning {cast to pointer from integer of different size} "" { target *-*-* } .-2 }
+// { dg-warning {cast to pointer from integer of different size} "" { target lp64 } .-2 }
 // { dg-error {expected primary-expression before 'struct'} "" { target *-*-* } .-3 }
 // { dg-error {expected '\)' before 'struct'} "" { target *-*-* } .-4 }
   { }
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-10 13:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-10 13:03 [PATCH] OpenMP: Fix new lvalue-parsing map/to/from tests for 32-bit targets Julian Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).