public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] libgomp.fortran/alloc-1.F90: Fix testcase for 32bit size_t
@ 2020-08-22 23:43 Giuliano Belinassi
  0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-22 23:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8ae61f94bdee4dcbdecc9ca76c498f6c88ebd3b4

commit 8ae61f94bdee4dcbdecc9ca76c498f6c88ebd3b4
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Wed Jul 15 17:23:04 2020 +0200

    libgomp.fortran/alloc-1.F90: Fix testcase for 32bit size_t
    
    libgomp/ChangeLog:
    
            * testsuite/libgomp.fortran/alloc-1.F90: Use c_size_t to
            avoid conversion on 32bit systems from 32bit to 64bit due
            to -fdefault-integer-8.

Diff:
---
 libgomp/testsuite/libgomp.fortran/alloc-1.F90 | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/libgomp/testsuite/libgomp.fortran/alloc-1.F90 b/libgomp/testsuite/libgomp.fortran/alloc-1.F90
index e19077a78d0..8ecb4c41246 100644
--- a/libgomp/testsuite/libgomp.fortran/alloc-1.F90
+++ b/libgomp/testsuite/libgomp.fortran/alloc-1.F90
@@ -1,8 +1,8 @@
 ! { dg-additional-options "-Wall -Wextra -Wno-maybe-uninitialized" }
 #ifdef DEFAULT_INTEGER_8
-#define ONEoFIVE 105_c_size_t*8
+#define ONEoFIVE 105_c_size_t*8_c_size_t
 #else
-#define ONEoFIVE 105_c_size_t*4
+#define ONEoFIVE 105_c_size_t*4_c_size_t
 #endif
       program main
         use iso_c_binding
@@ -58,7 +58,8 @@
         integer, pointer, volatile :: p(:), p0, q(:), r(:)
         integer (omp_allocator_handle_kind) :: a, a2
 
-        cp = omp_alloc (3 * c_sizeof (i), omp_default_mem_alloc)
+        cp = omp_alloc (3_c_size_t * c_sizeof (i),                      &
+     &                  omp_default_mem_alloc)
         if (mod (transfer (cp, intptr), 4_c_intptr_t) /= 0) stop 1
         call c_f_pointer (cp, p, [3])
         p(1) = 1
@@ -66,7 +67,8 @@
         p(3) = 3
         call omp_free (cp, omp_default_mem_alloc)
 
-        cp = omp_alloc (2 * c_sizeof (i), omp_default_mem_alloc)
+        cp = omp_alloc (2_c_size_t * c_sizeof (i),                      &
+     &                  omp_default_mem_alloc)
         if (mod (transfer (cp, intptr), 4_c_intptr_t) /= 0) stop 2
         call c_f_pointer (cp, p, [2])
         p(1) = 1
@@ -121,7 +123,8 @@
         if (a2 == omp_null_allocator) stop 10
         cp = omp_alloc (ONEoFIVE, a2)
         if (mod (transfer (cp, intptr), 32_c_intptr_t) /= 0) stop 11
-        call c_f_pointer (cp, p, [ONEoFIVE / c_sizeof (i)])
+        call c_f_pointer (cp, p, [ONEoFIVE                              &
+     &                            / c_sizeof (i)])
         p(1) = 5
         p(ONEoFIVE / c_sizeof (i)) = 6
         cq = omp_alloc (768_c_size_t, a2)
@@ -149,9 +152,11 @@
      &                           size (traits5), traits5)
         if (a2 == omp_null_allocator) stop 16
         call omp_set_default_allocator (a2)
-        cp = omp_alloc (ONEoFIVE, omp_null_allocator)
+        cp = omp_alloc (ONEoFIVE,                                       &
+     &                  omp_null_allocator)
         if (mod (transfer (cp, intptr), 32_c_intptr_t) /= 0) stop 17
-        call c_f_pointer (cq, q, [ONEoFIVE / c_sizeof (i)])
+        call c_f_pointer (cq, q, [ONEoFIVE                              &
+     &                            / c_sizeof (i)])
         p(1) = 5
         p(ONEoFIVE / c_sizeof (i)) = 6
         cq = omp_alloc (768_c_size_t, omp_null_allocator)


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

only message in thread, other threads:[~2020-08-22 23:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 23:43 [gcc/devel/autopar_devel] libgomp.fortran/alloc-1.F90: Fix testcase for 32bit size_t Giuliano Belinassi

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).