public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Thomas König" <tk@tkoenig.net>
To: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [patch, fortran, testsuite, committed] Fix some more coarray stuff
Date: Sun, 20 Dec 2020 16:24:50 +0100	[thread overview]
Message-ID: <7225a042-9736-19a2-1040-b60a829007bc@tkoenig.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

Hi,

I have just committed the attached patch to a test case that
was failing on the shared coarray branch.

Again, the person who wrote the test case depended on only
running on a single image :-)

Best regards

	Thomas

Correct coarray indices for test case.

gcc/testsuite/ChangeLog:

	* gfortran.dg/coarray/send_char_array_1.f90: Correct coarray
	indces.

[-- Attachment #2: p1.diff --]
[-- Type: text/x-patch, Size: 1784 bytes --]

diff --git a/gcc/testsuite/gfortran.dg/coarray/send_char_array_1.f90 b/gcc/testsuite/gfortran.dg/coarray/send_char_array_1.f90
index 3e16fa83685..b3caf80b1ad 100644
--- a/gcc/testsuite/gfortran.dg/coarray/send_char_array_1.f90
+++ b/gcc/testsuite/gfortran.dg/coarray/send_char_array_1.f90
@@ -25,28 +25,28 @@ program send_convert_char_array
   allocate(character(kind=4, len=5)::co_str_k4_arr(4)[*])
 
   ! First check send/copy to self
-  co_str_k1_scal[1] = str_k1_scal
+  co_str_k1_scal[this_image()] = str_k1_scal
   if (co_str_k1_scal /= str_k1_scal // '          ') STOP 1
 
-  co_str_k4_scal[1] = str_k4_scal
+  co_str_k4_scal[this_image()] = str_k4_scal
   if (co_str_k4_scal /= str_k4_scal // 4_'          ') STOP 2
 
-  co_str_k4_scal[1] = str_k1_scal
+  co_str_k4_scal[this_image()] = str_k1_scal
   if (co_str_k4_scal /= str_k4_scal // 4_'          ') STOP 3
 
-  co_str_k1_scal[1] = str_k4_scal
+  co_str_k1_scal[this_image()] = str_k4_scal
   if (co_str_k1_scal /= str_k1_scal // '          ') STOP 4
 
-  co_str_k1_arr(:)[1] = str_k1_arr
+  co_str_k1_arr(:)[this_image()] = str_k1_arr
   if (any(co_str_k1_arr /= ['abc  ', 'EFG  ', 'klm  ', 'NOP  '])) STOP 5
  
-  co_str_k4_arr(:)[1] = [4_'abc', 4_'EFG', 4_'klm', 4_'NOP']! str_k4_arr
+  co_str_k4_arr(:)[this_image()] = [4_'abc', 4_'EFG', 4_'klm', 4_'NOP']! str_k4_arr
   if (any(co_str_k4_arr /= [4_'abc  ', 4_'EFG  ', 4_'klm  ', 4_'NOP  '])) STOP 6
 
-  co_str_k4_arr(:)[1] = str_k1_arr
+  co_str_k4_arr(:)[this_image()] = str_k1_arr
   if (any(co_str_k4_arr /= [ 4_'abc  ', 4_'EFG  ', 4_'klm  ', 4_'NOP  '])) STOP 7
 
-  co_str_k1_arr(:)[1] = str_k4_arr
+  co_str_k1_arr(:)[this_image()] = str_k4_arr
   if (any(co_str_k1_arr /= ['abc  ', 'EFG  ', 'klm  ', 'NOP  '])) STOP 8
 
 end program send_convert_char_array

                 reply	other threads:[~2020-12-20 15:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7225a042-9736-19a2-1040-b60a829007bc@tkoenig.net \
    --to=tk@tkoenig.net \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).