diff --git a/tests/checks/return.fish b/tests/checks/return.fish index b63e336e4..9c2d7a4c5 100644 --- a/tests/checks/return.fish +++ b/tests/checks/return.fish @@ -20,3 +20,16 @@ $fish -ic 'echo interactive-foo; return 69; echo interactive-bar' # but not bar echo $status # CHECK: 69 + +# Verify negative return values don't cause UB and never map to 0 +function empty_return + return $argv[1] +end + +for i in (seq -550 -1) + empty_return $i + if test $status -eq 0 + echo returning $i from a fish script maps to a $status of 0! + end +end +# CHECK: