Files
c3c/test/unit/stdlib/macros/core_builtins.c3
Christoffer Lerno a0a5c940f1 Add --strip-unused.
2023-02-16 22:11:42 +01:00

24 lines
387 B
Plaintext

module core_builtin_tests;
fn void! test_likely() @test
{
assert(@likely(2 > 1));
assert(@likely(2 > 1, 0.5));
}
fn void! test_unlikely() @test
{
assert(!@unlikely(2 < 1));
assert(!@unlikely(2 < 1, 0.5));
}
fn void! test_expect() @test
{
assert(@expect(2 > 1, true));
assert(!@expect(2 < 1, false));
assert(@expect(2 > 1, true, 0.5));
assert(!@expect(2 < 1, false, 0.5));
}