* sim/cris/c/mmap1.c (MMAP_FLAGS): Default-define to
authorHans-Peter Nilsson <hp@axis.com>
Sat, 3 Jan 2009 19:22:16 +0000 (19:22 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Sat, 3 Jan 2009 19:22:16 +0000 (19:22 +0000)
MAP_PRIVATE and use this macro in the mmap call.
* sim/cris/c/mmap4.c: New test.

sim/testsuite/ChangeLog
sim/testsuite/sim/cris/c/mmap1.c
sim/testsuite/sim/cris/c/mmap4.c [new file with mode: 0644]

index d5bc103e1bd6e2418ff3649a0c8183977ed11ed6..6bf8ccb6bbf868bf777d851f2cd26aa4c48d7ed9 100644 (file)
@@ -1,5 +1,8 @@
 2009-01-03  Hans-Peter Nilsson  <hp@axis.com>
 
+       * sim/cris/c/mmap1.c (MMAP_FLAGS): Default-define to
+       MAP_PRIVATE and use this macro in the mmap call.
+       * sim/cris/c/mmap4.c: New test.
        * sim/cris/c/access1.c: New test.
        * sim/cris/asm/pid1.ms: New test.
 
index b803f0c431e7d030250795c0a76d4131bfc09e87..9db94c1775154311cdc4b5c337341a8d6c33730b 100644 (file)
@@ -38,7 +38,11 @@ int main (int argc, char *argv[])
   if ((size & 8191) == 0)
     size--;
 
-  a = mmap (NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
+#ifndef MMAP_FLAGS
+#define MMAP_FLAGS MAP_PRIVATE
+#endif
+
+  a = mmap (NULL, size, PROT_READ, MMAP_FLAGS, fd, 0);
 
   if (memmem (a, size, str, strlen (str) + 1) == NULL)
     abort ();
diff --git a/sim/testsuite/sim/cris/c/mmap4.c b/sim/testsuite/sim/cris/c/mmap4.c
new file mode 100644 (file)
index 0000000..b3a66e4
--- /dev/null
@@ -0,0 +1,5 @@
+/* Just check that MAP_DENYWRITE is "honored" (ignored).
+#notarget: cris*-*-elf
+*/
+#define MMAP_FLAGS (MAP_PRIVATE|MAP_DENYWRITE)
+#include "mmap1.c"
This page took 0.028078 seconds and 4 git commands to generate.