aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2021-03-24 05:50:37 -0300
committerAlexandre Oliva <oliva@gnu.org>2021-03-24 06:48:23 -0300
commit65cfa2fed39c76498e7c3dfe138bddb049d60dd7 (patch)
tree52b7b58d8a326a05f1f74d5a0a5c090c388651b3 /gcc
parent9eec7c7686aedc79853699549d1c9eee0a0a84fd (diff)
downloadgcc-65cfa2fed39c76498e7c3dfe138bddb049d60dd7.zip
gcc-65cfa2fed39c76498e7c3dfe138bddb049d60dd7.tar.gz
gcc-65cfa2fed39c76498e7c3dfe138bddb049d60dd7.tar.bz2
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 triplets. I was a little nervous about dropping the triplets, and saw how they implied sysconf, so I left those alone. for gcc/ChangeLog * doc/sourcebuild.texi (sysconf): New effective target. for gcc/testsuite/ChangeLog * lib/target-supports.exp (check_effective_target_sysconf): New. * 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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/doc/sourcebuild.texi3
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95443-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr95443-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/strncmp-1.c2
-rw-r--r--gcc/testsuite/lib/target-supports.exp6
6 files changed, 13 insertions, 4 deletions
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 2bc362b..0104916 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 698dfa0..d846fcb 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 <stdint.h>
diff --git a/gcc/testsuite/gcc.target/i386/pr95443-2.c b/gcc/testsuite/gcc.target/i386/pr95443-2.c
index 23bb13a..2ab2606 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 <stdint.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c b/gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c
index 037f665..87705be 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 044fc5c..1ea3e0a 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 <stdio.h>
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 733b6c8..1230d19 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 {