]> git.ipfire.org Git - thirdparty/gcc.git/commit
[testsuite] adjust expectations of x86 vect-simd-clone tests
authorAlexandre Oliva <oliva@adacore.com>
Wed, 26 Feb 2025 10:39:18 +0000 (07:39 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Wed, 26 Feb 2025 10:39:18 +0000 (07:39 -0300)
commite6f5fadec5f6a719145ed2ed513209ec3e8eeb2f
tree394a3eda21118cef95c9571d2ac59b801195efbf
parent3b72464ba5e4597d2d559bcdbf150637adeb00b0
[testsuite] adjust expectations of x86 vect-simd-clone tests

Some vect-simd-clone tests fail when targeting ancient x86 variants,
because the expected transformations only take place with -msse4 or
higher.

So arrange for these tests to take an -msse4 option on x86, so that
the expected vectorization takes place, but decay to a compile test if
vect.exp would enable execution but the target doesn't have an sse4
runtime.  This requires the new dg-do-if to override the action on a
target while retaining the default action on others, instead of
disabling the test.

We can count on avx512f compile-time support for these tests, because
vect_simd_clones requires that on x86, and that implies sse4 support,
so we need not complicate the scan conditionals with tests for sse4,
except on the last test.

for  gcc/ChangeLog

* doc/sourcebuild.texi (dg-do-if): Document.

for  gcc/testsuite/ChangeLog

* lib/target-supports-dg.exp (dg-do-if): New.
* gcc.dg/vect/vect-simd-clone-16f.c: Use -msse4 on x86, and
skip in case execution is enabled but the runtime isn't.
* gcc.dg/vect/vect-simd-clone-17f.c: Likewise.
* gcc.dg/vect/vect-simd-clone-18f.c: Likewise.
* gcc.dg/vect/vect-simd-clone-20.c: Likewise, but only skip
the scan test.
gcc/doc/sourcebuild.texi
gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c
gcc/testsuite/gcc.dg/vect/vect-simd-clone-17f.c
gcc/testsuite/gcc.dg/vect/vect-simd-clone-18f.c
gcc/testsuite/gcc.dg/vect/vect-simd-clone-20.c
gcc/testsuite/lib/target-supports-dg.exp