Repository navigation
Expand file tree
/
Copy pathrun-tests-cast.py
More file actions
70 lines (63 loc) · 2.09 KB
/
Copy pathrun-tests-cast.py
File metadata and controls
70 lines (63 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import os
import sys
import compiler_dyn
import interp_Lvar
import interp_Lif
import interp_Lwhile
import interp_Ltup
import interp_Larray
import interp_Lfun
import interp_Llambda
import interp_Lany
import interp_Lcast
import interp_Cif
import interp_Ctup
import interp_Carray
import interp_Cfun
import interp_Clambda
import interp_Cany
import type_check_Lcast
import type_check_Lgrad
import type_check_Cany
import type_check_Lany
from interp_x86.eval_x86 import interp_x86
from utils import run_tests, run_one_test
the_compiler = compiler_dyn.Compiler()
type_check_dict = {
"source": type_check_Lcast.TypeCheckLcast().type_check,
"shrink": type_check_Lcast.TypeCheckLcast().type_check,
"reveal_casts": type_check_Lany.TypeCheckLany().type_check,
"remove_complex_operands": type_check_Lany.TypeCheckLany().type_check,
"explicate_control": type_check_Cany.TypeCheckCany().type_check,
}
interp_dict = {
"cast": interp_Lcast.InterpLcast().interp,
"shrink": interp_Lcast.InterpLcast().interp,
"uniquify": interp_Lcast.InterpLcast().interp,
"reveal_functions": interp_Lcast.InterpLcast().interp,
"cast_insert": interp_Lcast.InterpLcast().interp,
"reveal_casts": interp_Lcast.InterpLcast().interp,
"convert_assignments": interp_Lcast.InterpLcast().interp,
"convert_to_closures": interp_Lcast.InterpLcast().interp,
"limit_functions": interp_Lcast.InterpLcast().interp,
"expose_allocation": interp_Lcast.InterpLcast().interp,
"remove_complex_operands": interp_Lcast.InterpLcast().interp,
"explicate_control": interp_Cany.InterpCany().interp,
"select_instructions": interp_x86,
"assign_homes": interp_x86,
"allocate_registers": interp_x86,
"patch_instructions": interp_x86,
"prelude_and_conclusion": interp_x86,
}
if len(sys.argv) == 2:
one_test_file = sys.argv[1]
run_one_test(one_test_file, 'cast',
the_compiler, 'cast',
type_check_dict,
interp_dict,
)
else:
run_tests('cast', the_compiler, 'cast',
type_check_dict,
interp_dict,
)