new testing infrastructure

This commit is contained in:
Francesco Cozzuto
2023-01-22 02:22:44 +01:00
parent 533cf01920
commit 1780826a97
145 changed files with 1432 additions and 938 deletions
@@ -0,0 +1,19 @@
@type [compiler]
@source
1 and 2;
@bytecode
PUSHINT 1;
JUMPIFNOTANDPOP false;
PUSHINT 2;
JUMPIFNOTANDPOP false;
PUSHTRU;
JUMP end;
false:
PUSHFLS;
end:
POP 1;
EXIT;
@@ -0,0 +1,19 @@
@type [compiler]
@source
1 or 2;
@bytecode
PUSHINT 1;
JUMPIFANDPOP true;
PUSHINT 2;
JUMPIFANDPOP true;
PUSHFLS;
JUMP end;
true:
PUSHTRU;
end:
POP 1;
EXIT;
@@ -0,0 +1,35 @@
@type [compiler]
@source
A and B or C and D;
@bytecode
PUSHVAR "A";
JUMPIFNOTANDPOP false_0;
PUSHVAR "B";
JUMPIFNOTANDPOP false_0;
PUSHTRU;
JUMP end_0;
false_0:
PUSHFLS;
end_0:
JUMPIFANDPOP true_2;
PUSHVAR "C";
JUMPIFNOTANDPOP false_1;
PUSHVAR "D";
JUMPIFNOTANDPOP false_1;
PUSHTRU;
JUMP end_1;
false_1:
PUSHFLS;
end_1:
JUMPIFANDPOP true_2;
PUSHFLS;
JUMP end_2;
true_2:
PUSHTRU;
end_2:
POP 1;
EXIT;
@@ -0,0 +1,35 @@
@type [compiler]
@source
X or Y and Z or W;
@bytecode
PUSHVAR "X";
JUMPIFANDPOP true_0;
PUSHVAR "Y";
JUMPIFNOTANDPOP false_1;
PUSHVAR "Z";
JUMPIFNOTANDPOP false_1;
PUSHTRU;
JUMP end_1;
false_1:
PUSHFLS;
end_1:
JUMPIFANDPOP true_0;
PUSHFLS;
JUMP end_0;
true_0:
PUSHTRU;
end_0:
JUMPIFANDPOP true_2;
PUSHVAR "W";
JUMPIFANDPOP true_2;
PUSHFLS;
JUMP end_2;
true_2:
PUSHTRU;
end_2:
POP 1;
EXIT;