From 850106058f6bb69dad1f8fb711c5a978b977b2a9 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Thu, 15 Jul 2021 14:20:57 +0000 Subject: [PATCH] vppinfra: fix the vector funcs test for march variants Type: fix Signed-off-by: Mohsin Kazmi Change-Id: I4208c2622817eb51a4b192cf420f9f1b5f193eef --- src/vppinfra/vector/test/test.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/vppinfra/vector/test/test.c b/src/vppinfra/vector/test/test.c index 0e90bacce49..1a8b9d6ea10 100644 --- a/src/vppinfra/vector/test/test.c +++ b/src/vppinfra/vector/test/test.c @@ -7,6 +7,17 @@ test_registration_t *test_registrations[CLIB_MARCH_TYPE_N_VARIANTS] = {}; +int +test_march_supported (clib_march_variant_type_t type) +{ +#define _(s, n) \ + if (CLIB_MARCH_VARIANT_TYPE_##s == type) \ + return clib_cpu_march_priority_##s (); + foreach_march_variant +#undef _ + return 0; +} + int main (int argc, char *argv[]) { @@ -16,7 +27,7 @@ main (int argc, char *argv[]) { test_registration_t *r = test_registrations[i]; - if (r == 0) + if (r == 0 || test_march_supported (i) < 0) continue; fformat (stdout, "\nMultiarch Variant: %U\n", format_march_variant, i); -- 2.16.6