From e383af639a9bc72e2f203c00c2e07806746bbe66 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 29 Dec 2020 10:56:08 -0500 Subject: [PATCH] pan/bi: Test pack_literal Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/bifrost/bi_pack.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index fcbbf52dd68..4e8af2ff43d 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -942,8 +942,17 @@ bi_pack(bi_context *ctx, struct util_dynarray *emission) #ifndef NDEBUG +static void +bi_test_pack_literal(void) +{ + for (unsigned x = 0; x <= 7; ++x) + assert(bi_pack_literal(BI_CLAUSE_SUBWORD_LITERAL_0 + x) == x); +} + int bi_test_packing(void) { + bi_test_pack_literal(); + return 0; } #endif