aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vector
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2021-07-15 14:20:57 +0000
committerDamjan Marion <dmarion@me.com>2021-07-15 16:28:30 +0000
commit850106058f6bb69dad1f8fb711c5a978b977b2a9 (patch)
tree21010ac362eb676caf9b0d94f37f3f43a46900e9 /src/vppinfra/vector
parent5be3d4cc59ea955cff35ef962fd908e1147eea99 (diff)
vppinfra: fix the vector funcs test for march variants
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I4208c2622817eb51a4b192cf420f9f1b5f193eef
Diffstat (limited to 'src/vppinfra/vector')
-rw-r--r--src/vppinfra/vector/test/test.c13
1 files changed, 12 insertions, 1 deletions
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
@@ -8,6 +8,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[])
{
clib_mem_init (0, 64ULL << 20);
@@ -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);