-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·40 lines (37 loc) · 1.04 KB
/
run.sh
File metadata and controls
executable file
·40 lines (37 loc) · 1.04 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
#!/bin/bash
if [ ${#} -lt 1 ]; then
echo "USAGE: $(basename $0) file.ll"
exit 1
fi
file="${1}"
program="${file%.ll}"
input="${program}.in"
output="${program}.out"
groundtruth="${program}.groundtruth"
echo "compiling and linking LLVM IR ${file}"
echo clang -o "${program}" "${file}"
clang -o "${program}" "${file}"
echo "running ${program}"
if [ -f "${input}" ]; then
echo "\"${program}\" > \"${output}\" < \"${input}\""
"${program}" > "${output}" < "${input}"
else
echo "\"${program}\" > \"${output}\""
"${program}" > "${output}"
fi
# this is now done in testcasesScript.py
# # compare against ground truth output if available
# if [ -f "${groundtruth}" ]; then
# echo diff --strip-trailing-cr "${groundtruth}" "${output}"
# diff --strip-trailing-cr "${groundtruth}" "${output}"
# result="${?}"
# if [ "${result}" == "0" ]; then
# echo "correct output of ${file}"
# exit 0
# else
# echo "INCORRECT output of ${file} compared to the ground truth output"
# exit 0
# fi
# else
# exit 0
# fi