This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#!/usr/bin/env bash
set -euo pipefail
if[[$# -lt 1||$# -gt 3]];then
echo"用法: $0 <input.sy> [output_dir] [--run]" >&2
exit1
fi
input=$1
out_dir="test/test_result/asm"
run_exec=false
shift
while[[$# -gt 0]];do
case"$1" in
--run)
run_exec=true
;;
*)
out_dir="$1"
;;
esac
shift
done
if[[ ! -f "$input"]];then
echo"输入文件不存在: $input" >&2
exit1
fi
compiler="./build/bin/compiler"
if[[ ! -x "$compiler"]];then
echo"未找到编译器: $compiler ,请先构建。" >&2
exit1
fi
if ! command -v aarch64-linux-gnu-gcc >/dev/null 2>&1;then