simplify _loop so that the "prologe" is shorter and the jump is back into
the first < 5 bytes
This commit is contained in:
@@ -32,10 +32,10 @@ TEST_CASE("Advanced instruction functions work as expected, unhokked") {
|
||||
}
|
||||
|
||||
TEST_CASE("Loops & tail recursion work as expected, unhook") {
|
||||
REQUIRE(_loop(2, 3) == 8);
|
||||
REQUIRE(_loop(5, 3) == 125);
|
||||
REQUIRE(_loop(5, 0) == 1);
|
||||
REQUIRE(_loop(5, 1) == 5);
|
||||
REQUIRE(_loop(1) == 1);
|
||||
REQUIRE(_loop(2) == 4);
|
||||
REQUIRE(_loop(3) == 18);
|
||||
REQUIRE(_loop(5) == 25*24);
|
||||
|
||||
REQUIRE(_tail_recursion(0) == 1);
|
||||
REQUIRE(_tail_recursion(1) == 1);
|
||||
|
||||
Reference in New Issue
Block a user