diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-07-29 06:04:29 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-15 10:04:35 +0900 |
| commit | bd5bbdebf116bb03da335d0e18a55a5597b55548 (patch) | |
| tree | 978a9c6c4240c6997dead272e33c0019c173734c /tests | |
| parent | 53eec2c3f3e0de5b252215fb662e50e0c1829513 (diff) | |
| download | ducc-bd5bbdebf116bb03da335d0e18a55a5597b55548.tar.gz ducc-bd5bbdebf116bb03da335d0e18a55a5597b55548.tar.zst ducc-bd5bbdebf116bb03da335d0e18a55a5597b55548.zip | |
feat: function main() now returns zero if no return value are explicitly provided
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/064.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/064.sh b/tests/064.sh new file mode 100644 index 0000000..80fba4f --- /dev/null +++ b/tests/064.sh @@ -0,0 +1,22 @@ +set -e + +# C99: 5.1.2.2.3 +bash ../../test_exit_code.sh 0 <<'EOF' +int main() { +} +EOF + +bash ../../test_exit_code.sh 0 <<'EOF' +int main() { + 1 + 2 + 3; +} +EOF + +bash ../../test_exit_code.sh 0 <<'EOF' +int main() { + if (1) { + } else { + return 1; + } +} +EOF |
