aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/001.sh
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-05-03 13:44:48 +0900
committernsfisis <nsfisis@gmail.com>2025-05-03 13:44:48 +0900
commit0177c5753334cc3120e52871bedc9ea836c99022 (patch)
tree4bf0f5cbce99763f83ad55baec9ae329b1619524 /tests/001.sh
parent3ca8ddc7b2825e8a91f02c3cb1262ab064467030 (diff)
downloadP4Dcc-0177c5753334cc3120e52871bedc9ea836c99022.tar.gz
P4Dcc-0177c5753334cc3120e52871bedc9ea836c99022.tar.zst
P4Dcc-0177c5753334cc3120e52871bedc9ea836c99022.zip
binary arightmetic operations
Diffstat (limited to 'tests/001.sh')
-rw-r--r--tests/001.sh13
1 files changed, 10 insertions, 3 deletions
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