-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-all.sh
executable file
·94 lines (81 loc) · 2.84 KB
/
run-all.sh
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
# A simple for running benchmarks and checking them script
# replace "YOUR/ABSOLUTE/PATH" with the absolute path to antlr as well as the project
printf "Running benchmarks.....\n\n"
cd benchmarks
printf "Running LLVM Stack Based Implementation Benchmark Tests.....\n"
printf "~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n\n"
for file in * ;
do
[ -e a.out ] && rm a.out
if [ $file != "a.out" ];
then
printf "$file test:\n\n"
java -cp ${CLASSPATH}:/YOUR/ABSOLUTE/PATH/.m2/repository/org/antlr/antlr4-runtime/4.7.1/antlr4-runtime-4.7.1.jar:/YOUR/ABSOLUTE/PATH/mini-compiler-java/target/classes mini.MiniCompiler $file/$file.mini -s -no
if [ -e $file.ll ];
then
clang $file.ll ../src/main/java/mini/malloc_helper.c ../src/main/java/mini/read_helper.c
if [ -e a.out ];
then
chmod 777 $file/input
./a.out < $file/input > $file.results
diff $file.results $file/output | head -n 15
[ -e $file.results ] && rm $file.results
fi
[ -e $file.ll ] && rm $file.ll
[ -e $file.s ] && rm $file.s
fi
printf "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"
fi
done
printf "Running LLVM SSA Benchmark Tests.....\n"
printf "~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n\n"
for file in * ;
do
[ -e a.out ] && rm a.out
if [ $file != "a.out" ];
then
printf "$file test:\n\n"
java -cp ${CLASSPATH}:/YOUR/ABSOLUTE/PATH/.m2/repository/org/antlr/antlr4-runtime/4.7.1/antlr4-runtime-4.7.1.jar:/YOUR/ABSOLUTE/PATH/mini-compiler-java/target/classes mini.MiniCompiler $file/$file.mini -no
if [ -e $file.ll ];
then
clang $file.ll ../src/main/java/mini/malloc_helper.c ../src/main/java/mini/read_helper.c
if [ -e a.out ];
then
chmod 777 $file/input
./a.out < $file/input > $file.results
diff $file.results $file/output | head -n 15
[ -e $file.results ] && rm $file.results
fi
[ -e $file.ll ] && rm $file.ll
[ -e $file.s ] && rm $file.s
fi
printf "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"
fi
done
printf "Running LLVM SSA Benchmark Tests with Optimizations.....\n"
printf "~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n\n"
for file in * ;
do
[ -e a.out ] && rm a.out
if [ $file != "a.out" ];
then
printf "$file test:\n\n"
java -cp ${CLASSPATH}:/YOUR/ABSOLUTE/PATH/.m2/repository/org/antlr/antlr4-runtime/4.7.1/antlr4-runtime-4.7.1.jar:/YOUR/ABSOLUTE/PATH/mini-compiler-java/target/classes mini.MiniCompiler $file/$file.mini
if [ -e $file.ll ];
then
clang $file.ll ../src/main/java/mini/malloc_helper.c ../src/main/java/mini/read_helper.c
if [ -e a.out ];
then
chmod 777 $file/input
./a.out < $file/input > $file.results
diff $file.results $file/output | head -n 15
[ -e $file.results ] && rm $file.results
fi
[ -e $file.ll ] && rm $file.ll
[ -e $file.s ] && rm $file.s
fi
printf "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"
fi
done
exit