From 0177c5753334cc3120e52871bedc9ea836c99022 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 3 May 2025 13:44:48 +0900 Subject: binary arightmetic operations --- tests/001.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tests/001.sh') diff --git a/tests/001.sh b/tests/001.sh index 9245cf6..70e00f5 100644 --- a/tests/001.sh +++ b/tests/001.sh @@ -5,10 +5,17 @@ int main() { EOF "$p4dcc" < main.c > main.s +if [[ $? -ne 0 ]]; then + cat main.s >&2 + exit 1 +fi gcc -o a.out main.s -set +e ./a.out exit_code=$? -set -e -test $exit_code -eq 42 +expected=42 + +if [[ ! $exit_code -eq $expected ]]; then + echo "expected $expected, but $exit_code" >&2 + exit 1 +fi -- cgit v1.2.3-70-g09d2