updated compiler testcases

This commit is contained in:
cozis
2022-12-07 18:45:22 +01:00
parent 98374ee491
commit 60c2d3ea88
6 changed files with 10 additions and 107 deletions
+1 -11
View File
@@ -12,18 +12,8 @@
POP 1; POP 1;
JUMP end; JUMP end;
fun: fun:
PUSHTYP;
PUSHVAR "None"; PUSHVAR "None";
PUSHTYP; CHECKTYPE 0, "a";
PUSHTYPTYP;
EQL;
JUMPIFNOTANDPOP arg_annot_not_type;
EQL;
JUMPIFANDPOP arg_ok;
ERROR "Bad type for argument 0";
arg_annot_not_type:
ERROR "Argument 0 type annotation 0 is not a type";
arg_ok:
ASS "a"; ASS "a";
POP 1; POP 1;
PUSHVAR "a"; PUSHVAR "a";
+1 -11
View File
@@ -14,18 +14,8 @@
fun: fun:
ASS "b"; ASS "b";
POP 1; POP 1;
PUSHTYP;
PUSHVAR "int"; PUSHVAR "int";
PUSHTYP; CHECKTYPE 0, "a";
PUSHTYPTYP;
EQL;
JUMPIFNOTANDPOP arg0_annot0_bad;
EQL;
JUMPIFANDPOP arg_ok;
ERROR "Bad type for argument 0";
arg0_annot0_bad:
ERROR "Argument 0 type annotation 0 is not a type";
arg_ok:
ASS "a"; ASS "a";
POP 1; POP 1;
PUSHVAR "a"; PUSHVAR "a";
+1 -11
View File
@@ -12,18 +12,8 @@
POP 1; POP 1;
JUMP end; JUMP end;
fun: fun:
PUSHTYP;
PUSHVAR "int"; PUSHVAR "int";
PUSHTYP; CHECKTYPE 1, "b";
PUSHTYPTYP;
EQL;
JUMPIFNOTANDPOP annot_bad;
EQL;
JUMPIFANDPOP arg_ok;
ERROR "Bad type for argument 1";
annot_bad:
ERROR "Argument 1 type annotation 0 is not a type";
arg_ok:
ASS "b"; ASS "b";
POP 1; POP 1;
ASS "a"; ASS "a";
+2 -22
View File
@@ -12,32 +12,12 @@
POP 1; POP 1;
JUMP end; JUMP end;
fun: fun:
PUSHTYP;
PUSHVAR "int"; PUSHVAR "int";
PUSHTYP; CHECKTYPE 1, "b";
PUSHTYPTYP;
EQL;
JUMPIFNOTANDPOP arg1_annot0_not_type;
EQL;
JUMPIFANDPOP arg1_ok;
ERROR "Bad type for argument 1";
arg1_annot0_not_type:
ERROR "Argument 1 type annotation 0 is not a type";
arg1_ok:
ASS "b"; ASS "b";
POP 1; POP 1;
PUSHTYP;
PUSHVAR "int"; PUSHVAR "int";
PUSHTYP; CHECKTYPE 0, "a";
PUSHTYPTYP;
EQL;
JUMPIFNOTANDPOP arg0_annot0_not_type;
EQL;
JUMPIFANDPOP arg0_ok;
ERROR "Bad type for argument 0";
arg0_annot0_not_type:
ERROR "Argument 0 type annotation 0 is not a type";
arg0_ok:
ASS "a"; ASS "a";
POP 1; POP 1;
PUSHVAR "a"; PUSHVAR "a";
+4 -40
View File
@@ -12,52 +12,16 @@
POP 1; POP 1;
JUMP end; JUMP end;
fun: fun:
PUSHTYP;
PUSHVAR "bool"; PUSHVAR "bool";
PUSHTYP;
PUSHTYPTYP;
EQL;
JUMPIFNOTANDPOP arg1_annot0_bad;
EQL;
JUMPIFANDPOP arg1_ok;
PUSHTYP;
PUSHVAR "Map"; PUSHVAR "Map";
PUSHTYP; STP;
PUSHTYPTYP; CHECKTYPE 1, "b";
EQL;
JUMPIFNOTANDPOP arg1_annot1_bad;
EQL;
JUMPIFANDPOP arg1_ok;
ERROR "Bad type for argument 1";
arg1_annot0_bad:
ERROR "Argument 1 type annotation 0 is not a type";
arg1_annot1_bad:
ERROR "Argument 1 type annotation 1 is not a type";
arg1_ok:
ASS "b"; ASS "b";
POP 1; POP 1;
PUSHTYP;
PUSHVAR "int"; PUSHVAR "int";
PUSHTYP;
PUSHTYPTYP;
EQL;
JUMPIFNOTANDPOP arg0_annot0_bad;
EQL;
JUMPIFANDPOP arg0_ok;
PUSHTYP;
PUSHVAR "float"; PUSHVAR "float";
PUSHTYP; STP;
PUSHTYPTYP; CHECKTYPE 0, "a";
EQL;
JUMPIFNOTANDPOP arg0_annot1_bad;
EQL;
JUMPIFANDPOP arg0_ok;
ERROR "Bad type for argument 0";
arg0_annot0_bad:
ERROR "Argument 0 type annotation 0 is not a type";
arg0_annot1_bad:
ERROR "Argument 0 type annotation 1 is not a type";
arg0_ok:
ASS "a"; ASS "a";
POP 1; POP 1;
PUSHVAR "a"; PUSHVAR "a";
+1 -12
View File
@@ -18,19 +18,8 @@ nop:
POP 1; POP 1;
PUSHINT 1; PUSHINT 1;
not_none: not_none:
PUSHTYP;
PUSHVAR "int"; PUSHVAR "int";
PUSHTYP; CHECKTYPE 0, "a";
PUSHTYPTYP;
EQL;
JUMPIFNOTANDPOP annot_not_ok;
EQL;
JUMPIFANDPOP type_ok;
ERROR "Bad type for argument 0";
annot_not_ok:
ERROR "Argument 0 type annotation 0 is not a type";
type_ok:
ASS "a"; ASS "a";
POP 1; POP 1;
RETURN 0; RETURN 0;