public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-11] libgomp.oacc-fortran/firstprivate-int.f90 fix for nonexisting kind-16 int
@ 2021-05-13 16:15 Kwok Yeung
  0 siblings, 0 replies; only message in thread
From: Kwok Yeung @ 2021-05-13 16:15 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6e9f0a40990b5af0f25528f39a5864fb58e0d7f9

commit 6e9f0a40990b5af0f25528f39a5864fb58e0d7f9
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Thu Jul 16 14:37:23 2020 +0200

    libgomp.oacc-fortran/firstprivate-int.f90 fix for nonexisting kind-16 int
    
    libgomp/
            * testsuite/libgomp.oacc-fortran/firstprivate-int.f90: Use
            highest available integer kind instead of assuming that kind=16 exists.

Diff:
---
 libgomp/ChangeLog.omp                                       |  5 +++++
 libgomp/testsuite/libgomp.oacc-fortran/firstprivate-int.f90 | 12 ++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index 30a8f71906d..3aa666fdebb 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,3 +1,8 @@
+2020-07-16  Tobias Burnus  <tobias@codesourcery.com>
+
+	* testsuite/libgomp.oacc-fortran/firstprivate-int.f90: Use
+	highest available integer kind instead of assuming that kind=16 exists.
+
 2020-07-15  Julian Brown  <julian@codesourcery.com>
 
 	* testsuite/libgomp.oacc-c-c++-common/broadcast-many.c: New test.
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/firstprivate-int.f90 b/libgomp/testsuite/libgomp.oacc-fortran/firstprivate-int.f90
index 3b148ce7517..abc175f37e3 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/firstprivate-int.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/firstprivate-int.f90
@@ -3,19 +3,22 @@
 ! { dg-do run }
 
 program test
+  use iso_fortran_env, only: integer_kinds
   implicit none
 
   integer (kind=1)  :: i1i, i1o
   integer (kind=2)  :: i2i, i2o
   integer (kind=4)  :: i4i, i4o
   integer (kind=8)  :: i8i, i8o
-  integer (kind=16) :: i16i, i16o
+! Use highest-precision integer, which might be less than '16'
+! assume integer_kinds == logical_kinds
+  integer (kind=maxval(integer_kinds)) :: i16i, i16o
 
   logical (kind=1)  :: l1i, l1o
   logical (kind=2)  :: l2i, l2o
   logical (kind=4)  :: l4i, l4o
   logical (kind=8)  :: l8i, l8o
-  logical (kind=16) :: l16i, l16o
+  logical (kind=maxval(integer_kinds)) :: l16i, l16o
 
   real (kind=4)  :: r4i, r4o
   real (kind=8)  :: r8i, r8o
@@ -108,19 +111,20 @@ subroutine subtest(i1i, i2i, i4i, i8i, i16i, i1o, i2o, i4o, i8o, i16o, &
                    l1i, l2i, l4i, l8i, l16i, l1o, l2o, l4o, l8o, l16o, &
                    r4i, r8i, r4o, r8o, c4i, c8i, c4o, c8o, &
                    ch1i, ch4i, ch1o, ch4o)
+  use iso_fortran_env, only: integer_kinds
   implicit none
 
   integer (kind=1)  :: i1i, i1o
   integer (kind=2)  :: i2i, i2o
   integer (kind=4)  :: i4i, i4o
   integer (kind=8)  :: i8i, i8o
-  integer (kind=16) :: i16i, i16o
+  integer (kind=maxval(integer_kinds)) :: i16i, i16o
 
   logical (kind=1)  :: l1i, l1o
   logical (kind=2)  :: l2i, l2o
   logical (kind=4)  :: l4i, l4o
   logical (kind=8)  :: l8i, l8o
-  logical (kind=16) :: l16i, l16o
+  logical (kind=maxval(integer_kinds)) :: l16i, l16o
 
   real (kind=4)  :: r4i, r4o
   real (kind=8)  :: r8i, r8o


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

only message in thread, other threads:[~2021-05-13 16:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 16:15 [gcc/devel/omp/gcc-11] libgomp.oacc-fortran/firstprivate-int.f90 fix for nonexisting kind-16 int Kwok Yeung

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