Skip to content

Commit 0ea12d9

Browse files
committed
test/func/cheri: verify representability of sizeclasses
1 parent 50c7500 commit 0ea12d9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/test/func/cheri/cheri.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,21 @@ int main()
259259
}
260260
}
261261

262+
message("Verify sizeclass representability");
263+
{
264+
for (size_t sc = 0; sc < NUM_SMALL_SIZECLASSES; sc++)
265+
{
266+
size_t sz = sizeclass_full_to_size(sizeclass_t::from_small_class(sc));
267+
SNMALLOC_CHECK(sz == Aal::capptr_size_round(sz));
268+
}
269+
270+
for (size_t sc = 0; sc < bits::BITS; sc++)
271+
{
272+
size_t sz = sizeclass_full_to_size(sizeclass_t::from_large_class(sc));
273+
SNMALLOC_CHECK(sz == Aal::capptr_size_round(sz));
274+
}
275+
}
276+
262277
message("CHERI checks OK");
263278
return 0;
264279
}

0 commit comments

Comments
 (0)