From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 39D773858002; Wed, 24 Mar 2021 09:07:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39D773858002 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] run sysconf-requiring test on systems that support it X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 0a5f899441bb67a245b6833ac399e678f8f42633 X-Git-Newrev: 415bbf965507f1eecae1924f80059ed12d46f4a5 Message-Id: <20210324090753.39D773858002@sourceware.org> Date: Wed, 24 Mar 2021 09:07:53 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 09:07:53 -0000 https://gcc.gnu.org/g:415bbf965507f1eecae1924f80059ed12d46f4a5 commit 415bbf965507f1eecae1924f80059ed12d46f4a5 Author: Alexandre Oliva Date: Wed Mar 24 05:50:37 2021 -0300 run sysconf-requiring test on systems that support it Some gcc.target/i386 tests requires the mmap feature, but that's not enough for the test to be able to call sysconf. This patch introduces a sysconf feature, analogous to mmap, and adds it to tests in gcc.target/i386 that call sysconf. There are other tests within gcc.dg and g++.dg that call sysconf, but I haven't added the tag to them, because they already cover it with target triples. I was a little nervous about dropping the triplets, and saw how they implied sysconf, so I left those alone. for gcc/testsuite/ChangeLog * lib/target-supports.exp (check_effective_target_sysconf): New. * gcc/doc/sourcebuild.texi (syconf): Document it. * gcc.target/i386/pr95443-1.c: Require it. * gcc.target/i386/pr95443-2.c: Likewise. * gcc.target/i386/sse2-mmx-maskmovq.c: Likewise. * gcc.target/i386/strncmp-1.c: Likewise. Diff: --- gcc/doc/sourcebuild.texi | 3 +++ gcc/testsuite/gcc.target/i386/pr95443-1.c | 2 +- gcc/testsuite/gcc.target/i386/pr95443-2.c | 2 +- gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c | 2 +- gcc/testsuite/gcc.target/i386/strncmp-1.c | 2 +- gcc/testsuite/lib/target-supports.exp | 6 ++++++ 6 files changed, 13 insertions(+), 4 deletions(-) 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 {