public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-8167] testsuite: Fix up libgomp.fortran/alloc-1.F90 testcase [PR100071]
Date: Wed, 14 Apr 2021 08:50:26 +0000 (GMT)	[thread overview]
Message-ID: <20210414085026.514F8397282D@sourceware.org> (raw)

https://gcc.gnu.org/g:287be7f7a587cb08eb88ecee39ff5556a22976d2

commit r11-8167-g287be7f7a587cb08eb88ecee39ff5556a22976d2
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Apr 14 10:48:56 2021 +0200

    testsuite: Fix up libgomp.fortran/alloc-1.F90 testcase [PR100071]
    
    As can be seen under valgrind, the testcase didn't bind in the last part
    the fortran pointers properly to the c pointers.
    
    2021-04-14  Jakub Jelinek  <jakub@redhat.com>
    
            PR testsuite/100071
            * testsuite/libgomp.fortran/alloc-1.F90: Call c_f_pointer after last
            cp = omp_alloc with cp, p arguments instead of cq, q and call
            c_f_pointer after last cq = omp_alloc with cq, q.

Diff:
---
 libgomp/testsuite/libgomp.fortran/alloc-1.F90 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libgomp/testsuite/libgomp.fortran/alloc-1.F90 b/libgomp/testsuite/libgomp.fortran/alloc-1.F90
index 8ecb4c41246..178ce771d45 100644
--- a/libgomp/testsuite/libgomp.fortran/alloc-1.F90
+++ b/libgomp/testsuite/libgomp.fortran/alloc-1.F90
@@ -155,12 +155,13 @@
         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                              &
+        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, omp_null_allocator)
         if (mod (transfer (cq, intptr), 128_c_intptr_t) /= 0) stop 18
+        call c_f_pointer (cq, q, [768 / c_sizeof (i)])
         q(1) = 7
         q(768 / c_sizeof (i)) = 8
         if (c_associated (omp_alloc (768_c_size_t, omp_null_allocator))) &


                 reply	other threads:[~2021-04-14  8:50 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=20210414085026.514F8397282D@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@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).