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
+2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * doc/sourcebuild.texi (Effective-Target Keywords, Environment
+ attributes): Document mmap.
+
2011-07-25 Anatoly Sokolov <aesok@post.ru>
* config/mmix/mmix.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS,
conversion functions and overflow is not always detected correctly by
those functions.
+@item mmap
+Target supports @code{mmap}.
+
@item newlib
Target supports Newlib.
+2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * 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 <paolo.carlini@oracle.com>
PR c++/49838
#include <limits.h>
-#ifdef __unix__ /* ??? Is that good enough? */
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#ifndef MAP_FIXED
#define MAP_FIXED 0
#endif
-#endif
#define MAP_START (void *)0x7fff8000
#define MAP_LEN 0x10000
+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
#include <limits.h>
-#ifdef __unix__ /* ??? Is that good enough? */
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#ifndef MAP_FIXED
#define MAP_FIXED 0
#endif
-#endif
#define MAP_START (void *)0x7fff8000
#define MAP_LEN 0x10000
+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
/* 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 <stddef.h>
#include <stdio.h>
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
+#ifndef MAP_ANON
+#define MAP_ANON 0
+#endif
#include <stdlib.h>
void __attribute__((noinline)) test (const char *p)
/* 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 <stddef.h>
#include <stdio.h>
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
+#ifndef MAP_ANON
+#define MAP_ANON 0
+#endif
#include <stdlib.h>
struct Flags {
-/* { 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 <sys/mman.h>
#include <stdio.h>
/* PR target/36533 */
-/* { dg-do run { target { { i?86-*-linux* x86_64-*-linux* } && ilp32 } } } */
+/* { dg-do run { target { mmap && ilp32 } } } */
/* { dg-options "-Os" } */
#include <string.h>
#include <sys/mman.h>
} "-fopenmp"]
}
+# Return 1 if the target supports mmap, 0 otherwise.
+
+proc check_effective_target_mmap {} {
+ return [check_no_compiler_messages mmap assembly {
+ #include <sys/mman.h>
+ }]
+}
+
# Return 1 if compilation with -pthread is error-free for trivial
# code, 0 otherwise.