Build the 6 per-opcode shift tests as a single executable, test_mips64r6_shift.c, to reduce the number of test binaries. Each opcode reports one TAP line.
All Release 6 tests now emit TAP: select it in the meson setup. Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Pierrick Bouvier <[email protected]> --- tests/tcg/mips64/test_mips64r6_shift.c | 60 ++++++++++++++++++++++++++ tests/tcg/mips64/meson.build | 9 +--- 2 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 tests/tcg/mips64/test_mips64r6_shift.c diff --git a/tests/tcg/mips64/test_mips64r6_shift.c b/tests/tcg/mips64/test_mips64r6_shift.c new file mode 100644 index 000000000000..928112e35c0d --- /dev/null +++ b/tests/tcg/mips64/test_mips64r6_shift.c @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* MIPS64R6 tests: variable shift */ + +#include "../include/tap.h" + +#define main test_mips64r6_sllv +#include "test_mips64r6_sllv.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_srav +#include "test_mips64r6_srav.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_srlv +#include "test_mips64r6_srlv.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_dsllv +#include "test_mips64r6_dsllv.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_dsrav +#include "test_mips64r6_dsrav.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_dsrlv +#include "test_mips64r6_dsrlv.c" +#undef main +#undef TEST_COUNT_TOTAL + +static const struct { + const char *name; + int32_t (*fn)(void); +} r6_tests[] = { + { "sllv", test_mips64r6_sllv }, + { "srav", test_mips64r6_srav }, + { "srlv", test_mips64r6_srlv }, + { "dsllv", test_mips64r6_dsllv }, + { "dsrav", test_mips64r6_dsrav }, + { "dsrlv", test_mips64r6_dsrlv }, +}; + +int main(void) +{ + unsigned count = sizeof(r6_tests) / sizeof(r6_tests[0]); + unsigned i; + + TAP_START(); + for (i = 0; i < count; i++) { + tap_report(!r6_tests[i].fn(), "MIPS64R6 variable shift %s", + r6_tests[i].name); + } + + return tap_done(); +} diff --git a/tests/tcg/mips64/meson.build b/tests/tcg/mips64/meson.build index d356689e54bf..894f8e9e23e1 100644 --- a/tests/tcg/mips64/meson.build +++ b/tests/tcg/mips64/meson.build @@ -32,16 +32,11 @@ tests_mips64r6 = [ '../mips64/test_mips64r6_crc.c', '../mips64/test_mips64r6_logic.c', '../mips64/test_mips64r6_multiply.c', - '../mips64/test_mips64r6_dsllv.c', - '../mips64/test_mips64r6_dsrav.c', - '../mips64/test_mips64r6_dsrlv.c', - '../mips64/test_mips64r6_sllv.c', - '../mips64/test_mips64r6_srav.c', - '../mips64/test_mips64r6_srlv.c', + '../mips64/test_mips64r6_shift.c', ] foreach src: tests_mips64r6 - tests += {src: {'cflags': '-march=mips64r6'}} + tests += {src: {'cflags': '-march=mips64r6', 'protocol': 'tap'}} endforeach foreach src: tests_mips_msa -- 2.55.0
