public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] testsuite: Fix up libgomp.fortran/alloc-1.F90 testcase [PR100071]
@ 2021-04-14  8:58 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-04-14  8:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: Tobias Burnus

Hi!

As can be seen under valgrind, the testcase didn't bind in the last part
the fortran pointers properly to the c pointers.

Tested on x86_64-linux, committed to trunk.

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.

--- libgomp/testsuite/libgomp.fortran/alloc-1.F90.jj	2020-07-18 00:05:57.245601544 +0200
+++ libgomp/testsuite/libgomp.fortran/alloc-1.F90	2021-04-14 10:35:19.425186364 +0200
@@ -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))) &


	Jakub


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

only message in thread, other threads:[~2021-04-14  8:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14  8:58 [committed] testsuite: Fix up libgomp.fortran/alloc-1.F90 testcase [PR100071] Jakub Jelinek

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