diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 2bc362be449..0104916e660 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2450,6 +2450,9 @@ all targets. @item stpcpy Target provides @code{stpcpy} function. +@item sysconf +Target supports @code{sysconf}. + @item trampolines Target supports trampolines. diff --git a/gcc/testsuite/gcc.target/i386/pr95443-1.c b/gcc/testsuite/gcc.target/i386/pr95443-1.c index 698dfa02189..d846fcbda0a 100644 --- a/gcc/testsuite/gcc.target/i386/pr95443-1.c +++ b/gcc/testsuite/gcc.target/i386/pr95443-1.c @@ -1,4 +1,4 @@ -/* { dg-do run { target mmap } } */ +/* { dg-do run { target { sysconf && mmap } } } */ /* { dg-options "-O2 -minline-all-stringops" } */ #include diff --git a/gcc/testsuite/gcc.target/i386/pr95443-2.c b/gcc/testsuite/gcc.target/i386/pr95443-2.c index 23bb13ab7ff..2ab260608bc 100644 --- a/gcc/testsuite/gcc.target/i386/pr95443-2.c +++ b/gcc/testsuite/gcc.target/i386/pr95443-2.c @@ -1,4 +1,4 @@ -/* { dg-do run { target mmap } } */ +/* { dg-do run { target { sysconf && mmap } } } */ /* { dg-options "-O2 -minline-all-stringops" } */ #include diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c index 037f665f117..87705be3f70 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c +++ b/gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c @@ -1,4 +1,4 @@ -/* { dg-do run { target mmap } } */ +/* { dg-do run { target { sysconf && mmap } } } */ /* { dg-options "-O2 -fno-strict-aliasing -msse2" } */ /* { dg-additional-options "-mno-mmx" { target { ! ia32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/strncmp-1.c b/gcc/testsuite/gcc.target/i386/strncmp-1.c index 044fc5cc5fa..1ea3e0a57c1 100644 --- a/gcc/testsuite/gcc.target/i386/strncmp-1.c +++ b/gcc/testsuite/gcc.target/i386/strncmp-1.c @@ -1,4 +1,4 @@ -/* { dg-do run { target mmap } } */ +/* { dg-do run { target { sysconf && mmap } } } */ /* { dg-options "-O2" } */ #include diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 733b6c84518..1230d194215 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1067,6 +1067,12 @@ proc check_effective_target_mmap {} { return [check_function_available "mmap"] } +# Return 1 if the target supports sysconf, 0 otherwise. + +proc check_effective_target_sysconf {} { + return [check_function_available "sysconf"] +} + # Return 1 if the target supports dlopen, 0 otherwise. proc check_effective_target_dlopen {} { return [check_no_compiler_messages dlopen executable {