From: Rainer Orth Date: Mon, 25 Jul 2011 16:44:22 +0000 (+0000) Subject: sourcebuild.texi (Effective-Target Keywords, [...]): Document mmap. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8175c19c1ba6e51ea44e00ea4bff5a3725ddbddb;p=gcc.git sourcebuild.texi (Effective-Target Keywords, [...]): Document mmap. gcc: * doc/sourcebuild.texi (Effective-Target Keywords, Environment attributes): Document mmap. gcc/testsuite: * lib/target-supports.exp (check_effective_target_mmap): New proc. * gcc.c-torture/execute/loop-2f.c: Remove #ifdef __unix__. * gcc.c-torture/execute/loop-2g.c: Likewise. * gcc.c-torture/execute/loop-2f.x: Load target-supports.exp. Require mmap support. * gcc.c-torture/execute/loop-2g.x: Likewise. * gcc.dg/20030711-1.c: Replace dg-do target list by mmap. (MAP_ANON): Provide default. * gcc.dg/20050826-1.c: Likewise. * gcc.target/i386/pr36533.c: Likewise. * gcc.dg/vect/pr49038.c: Remove dg-do run. Use dg-require-effective-target mmap. From-SVN: r176760 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c64a0611d25..8ffc8f10660 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-07-25 Rainer Orth + + * doc/sourcebuild.texi (Effective-Target Keywords, Environment + attributes): Document mmap. + 2011-07-25 Anatoly Sokolov * config/mmix/mmix.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS, diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 3d41c0d029e..ea6fedb2390 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1679,6 +1679,9 @@ Target might have errors of a few ULP in string to floating-point conversion functions and overflow is not always detected correctly by those functions. +@item mmap +Target supports @code{mmap}. + @item newlib Target supports Newlib. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 596ef6ae17d..b90356962f8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2011-07-25 Rainer Orth + + * lib/target-supports.exp (check_effective_target_mmap): New proc. + + * gcc.c-torture/execute/loop-2f.c: Remove #ifdef __unix__. + * gcc.c-torture/execute/loop-2g.c: Likewise. + * gcc.c-torture/execute/loop-2f.x: Load target-supports.exp. + Require mmap support. + * gcc.c-torture/execute/loop-2g.x: Likewise. + * gcc.dg/20030711-1.c: Replace dg-do target list by mmap. + (MAP_ANON): Provide default. + * gcc.dg/20050826-1.c: Likewise. + * gcc.target/i386/pr36533.c: Likewise. + * gcc.dg/vect/pr49038.c: Remove dg-do run. + Use dg-require-effective-target mmap. + 2011-07-25 Paolo Carlini PR c++/49838 diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2f.c b/gcc/testsuite/gcc.c-torture/execute/loop-2f.c index 9f544b9fcbd..4803d64daa9 100644 --- a/gcc/testsuite/gcc.c-torture/execute/loop-2f.c +++ b/gcc/testsuite/gcc.c-torture/execute/loop-2f.c @@ -1,6 +1,5 @@ #include -#ifdef __unix__ /* ??? Is that good enough? */ #include #include #include @@ -18,7 +17,6 @@ #ifndef MAP_FIXED #define MAP_FIXED 0 #endif -#endif #define MAP_START (void *)0x7fff8000 #define MAP_LEN 0x10000 diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2f.x b/gcc/testsuite/gcc.c-torture/execute/loop-2f.x index 334ef9cfe12..ad024dd4938 100644 --- a/gcc/testsuite/gcc.c-torture/execute/loop-2f.x +++ b/gcc/testsuite/gcc.c-torture/execute/loop-2f.x @@ -1,3 +1,9 @@ +load_lib target-supports.exp + +if { ! [check_effective_target_mmap] } { + return 1 +} + if [istarget "m68k-*-linux*"] { # the executable is at the same position the test tries to remap return 1 diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2g.c b/gcc/testsuite/gcc.c-torture/execute/loop-2g.c index 8792dbf586b..91af4132327 100644 --- a/gcc/testsuite/gcc.c-torture/execute/loop-2g.c +++ b/gcc/testsuite/gcc.c-torture/execute/loop-2g.c @@ -1,6 +1,5 @@ #include -#ifdef __unix__ /* ??? Is that good enough? */ #include #include #include @@ -18,7 +17,6 @@ #ifndef MAP_FIXED #define MAP_FIXED 0 #endif -#endif #define MAP_START (void *)0x7fff8000 #define MAP_LEN 0x10000 diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2g.x b/gcc/testsuite/gcc.c-torture/execute/loop-2g.x index 334ef9cfe12..ad024dd4938 100644 --- a/gcc/testsuite/gcc.c-torture/execute/loop-2g.x +++ b/gcc/testsuite/gcc.c-torture/execute/loop-2g.x @@ -1,3 +1,9 @@ +load_lib target-supports.exp + +if { ! [check_effective_target_mmap] } { + return 1 +} + if [istarget "m68k-*-linux*"] { # the executable is at the same position the test tries to remap return 1 diff --git a/gcc/testsuite/gcc.dg/20030711-1.c b/gcc/testsuite/gcc.dg/20030711-1.c index e76f54f2105..7649059c6cf 100644 --- a/gcc/testsuite/gcc.dg/20030711-1.c +++ b/gcc/testsuite/gcc.dg/20030711-1.c @@ -1,6 +1,6 @@ /* Test whether strncmp has not been "optimized" into memcmp nor any code with memcmp semantics. */ -/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* *-*-darwin* } } */ +/* { dg-do run { target mmap } } */ /* { dg-options "-O2" } */ #include #include @@ -8,6 +8,9 @@ #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif +#ifndef MAP_ANON +#define MAP_ANON 0 +#endif #include void __attribute__((noinline)) test (const char *p) diff --git a/gcc/testsuite/gcc.dg/20050826-1.c b/gcc/testsuite/gcc.dg/20050826-1.c index 9101fb0227a..e622505e7da 100644 --- a/gcc/testsuite/gcc.dg/20050826-1.c +++ b/gcc/testsuite/gcc.dg/20050826-1.c @@ -1,6 +1,6 @@ /* Test whether strncmp has not been "optimized" into memcmp nor any code with memcmp semantics. */ -/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* *-*-darwin* } } */ +/* { dg-do run { target mmap } } */ /* { dg-options "-O2" } */ #include #include @@ -9,6 +9,9 @@ #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif +#ifndef MAP_ANON +#define MAP_ANON 0 +#endif #include struct Flags { diff --git a/gcc/testsuite/gcc.dg/vect/pr49038.c b/gcc/testsuite/gcc.dg/vect/pr49038.c index 681e5d50a83..c760ef57b75 100644 --- a/gcc/testsuite/gcc.dg/vect/pr49038.c +++ b/gcc/testsuite/gcc.dg/vect/pr49038.c @@ -1,4 +1,4 @@ -/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* *-*-darwin* } } */ +/* { dg-require-effective-target mmap } */ #include #include diff --git a/gcc/testsuite/gcc.target/i386/pr36533.c b/gcc/testsuite/gcc.target/i386/pr36533.c index a271fea1cac..8d71ece199d 100644 --- a/gcc/testsuite/gcc.target/i386/pr36533.c +++ b/gcc/testsuite/gcc.target/i386/pr36533.c @@ -1,5 +1,5 @@ /* PR target/36533 */ -/* { dg-do run { target { { i?86-*-linux* x86_64-*-linux* } && ilp32 } } } */ +/* { dg-do run { target { mmap && ilp32 } } } */ /* { dg-options "-Os" } */ #include #include diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 30cca9922c3..f7027bdb6ab 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -697,6 +697,14 @@ proc check_effective_target_fopenmp {} { } "-fopenmp"] } +# Return 1 if the target supports mmap, 0 otherwise. + +proc check_effective_target_mmap {} { + return [check_no_compiler_messages mmap assembly { + #include + }] +} + # Return 1 if compilation with -pthread is error-free for trivial # code, 0 otherwise.