Repository navigation
Expand file tree
/
Copy pathrun-tests-array.py
More file actions
58 lines (51 loc) · 1.66 KB
/
Copy pathrun-tests-array.py
File metadata and controls
58 lines (51 loc) · 1.66 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
import os
import sys
import compiler_array
import interp_Pvar
import interp_Lvar
import interp_Lif
import interp_Lwhile
import interp_Ltup
import interp_Larray
import interp_Lfun
import interp_Llambda
import interp_Cif
import interp_Ctup
import interp_Carray
import type_check_Larray
import type_check_Carray
from interp_x86.eval_x86 import interp_x86
from utils import run_tests, run_one_test
the_compiler = compiler_array.Compiler()
type_check_dict = {
"source": type_check_Larray.TypeCheckLarray().type_check,
"shrink": type_check_Larray.TypeCheckLarray().type_check,
"remove_complex_operands": type_check_Larray.TypeCheckLarray().type_check,
"explicate_control": type_check_Carray.TypeCheckCarray().type_check,
}
interp_dict = {
"array": interp_Larray.InterpLarray().interp,
"shrink": interp_Larray.InterpLarray().interp,
"uniquify": interp_Larray.InterpLarray().interp,
"reveal_functions": interp_Larray.InterpLarray().interp,
"expose_allocation": interp_Larray.InterpLarray().interp,
"remove_complex_operands": interp_Larray.InterpLarray().interp,
"explicate_control": interp_Carray.InterpCarray().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, 'array',
the_compiler, 'array',
type_check_dict,
interp_dict,
)
else:
run_tests('array', the_compiler, 'array',
type_check_dict,
interp_dict,
)