public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Stam Markianos-Wright <stammark@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/ARM/heads/morello)] Fix up testsuite for purecap mmap behaviour
Date: Tue, 22 Nov 2022 12:42:36 +0000 (GMT)	[thread overview]
Message-ID: <20221122124236.DDE623858C1F@sourceware.org> (raw)

https://gcc.gnu.org/g:b239ebd117db9767f184e484850f71e8c5bc4438

commit b239ebd117db9767f184e484850f71e8c5bc4438
Author: Matthew Malcomson <matthew.malcomson@arm.com>
Date:   Fri Nov 11 10:57:37 2022 +0000

    Fix up testsuite for purecap mmap behaviour
    
    Simply need to use the PROT_MAX macro.

Diff:
---
 gcc/testsuite/gcc.dg/torture/pr69760.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/torture/pr69760.c b/gcc/testsuite/gcc.dg/torture/pr69760.c
index 53733c7c6a4..aed08e49644 100644
--- a/gcc/testsuite/gcc.dg/torture/pr69760.c
+++ b/gcc/testsuite/gcc.dg/torture/pr69760.c
@@ -17,6 +17,12 @@ test_func (double *a, int L, int m, int n, int N)
     }
 }
 
+#ifdef PROT_MAX
+# define PROT_MAX_RW PROT_MAX (PROT_READ | PROT_WRITE)
+#else
+# define PROT_MAX_RW 0
+#endif
+
 int
 main ()
 {
@@ -29,7 +35,7 @@ main ()
   long pgsz = sysconf(_SC_PAGESIZE);
   if (pgsz < sizeof (double) || pgsz > L * sizeof (double))
     return 0;
-  p = mmap ((void *) 0, L * n * sizeof (double), PROT_NONE,
+  p = mmap ((void *) 0, L * n * sizeof (double), PROT_NONE | PROT_MAX_RW,
 	    MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
   if (p == MAP_FAILED)
     return 0;

             reply	other threads:[~2022-11-22 12:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 12:42 Stam Markianos-Wright [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-11-11 10:57 Matthew Malcomson

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=20221122124236.DDE623858C1F@sourceware.org \
    --to=stammark@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).