Files
c3c/test/unit/regression/vector_mask_test.c3
Christoffer Lerno f3b71ed7eb - $$MASK_TO_INT and $$INT_TO_MASK to create bool masks from integers and back.
- Fix bug when creating bool vectors in certain cases.
2025-12-25 20:55:11 +01:00

10 lines
362 B
Plaintext

module vector_mask @test;
import std::io, std::math;
fn void to_from_mask()
{
int x = (bool[<9>]){ true, false, true, false, false, false, false, false, true }.mask_to_int();
test::eq(x, 0b100000101);
bool[<10>] mask = vector::mask_from_int(bool[<10>], x);
test::eq(mask, (bool[<10>]){ true, false, true, false, false, false, false, false, true, false });
}