On Wed, Mar 24, 2021 at 8:17 AM Uros Bizjak <ubiz...@gmail.com> wrote: > > On Wed, Mar 24, 2021 at 7:56 AM Alexandre Oliva <ol...@adacore.com> wrote: > > > > > > The gcc.target/i386 test sse2-mmx-maskmovq.c requires the mmap > > feature, but that's not enough for the test to be able to call > > sysconf. > > > > I've combined the target triplets used in other sysconf-calling tests, > > omitting non-x86 ones, with the preexisting mmap requirement in this > > test. > > There are several other tests in gcc.target/i386 directory that call sysconf: > > pr95443-1.c: size_t page_size = 2 * sysconf(_SC_PAGESIZE); > pr95443-2.c: size_t page_size = 2 * sysconf(_SC_PAGESIZE); > sse2-mmx-maskmovq.c: size_t page_size = sysconf(_SC_PAGESIZE); > strncmp-1.c: size_t page_size = sysconf(_SC_PAGESIZE); > > and they all have only: > > /* { dg-do run { target mmap } } */ > > without any other target selectors. > > Do these functions also fail, or is sse2-mmx-maskmovq.c special in some way?
Other than above, can you please introduce check_effectve_target_sysconf to lib/target-supports.exp (similar to existing check_effective_target_mmap) and use it instead of target selectors? The testsuite is moving away from target checks to feature tests, so bonus points if you also convert existing testcases to a new feature test. Uros. > > Regstrapped on x86_64-linux-gnu and cross-tested for x86_64-vx7r2 along > > with other patches, mostly for the testsuite. Ok to install? > > > > > > for gcc/testsuite/ChangeLog > > > > * gcc.target/i386/sse2-mmx-maskmovq.c: Require > > sysconf-supporting x86 target triplets. > > --- > > gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c > > b/gcc/testsuite/gcc.target/i386/sse2-mmx-maskmovq.c > > index 037f665f1178a..ad4bbf7c76451 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 { { *-*-linux* *-*-gnu* *-*-darwin[912]* > > *-*-uclinux* } && mmap } } } */ > > /* { dg-options "-O2 -fno-strict-aliasing -msse2" } */ > > /* { dg-additional-options "-mno-mmx" { target { ! ia32 } } } */ > > > > > > -- > > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > > Free Software Activist GNU Toolchain Engineer > > Vim, Vi, Voltei pro Emacs -- GNUlius Caesar