1211349Sjilles# $FreeBSD: releng/11.0/bin/sh/tests/builtins/return5.0 211349 2010-08-15 21:06:53Z jilles $
2211349Sjilles
3211349Sjillesif [ "$1" != nested ]; then
4211349Sjilles	f() {
5211349Sjilles		set -- nested
6211349Sjilles		. "$0"
7211349Sjilles		# Allow return to return from the function or the dot script.
8211349Sjilles		return 4
9211349Sjilles	}
10211349Sjilles	f
11211349Sjilles	exit $(($? ^ 4))
12211349Sjillesfi
13211349Sjilles# To trigger the bug, the following commands must be at the top level,
14211349Sjilles# with newlines in between.
15211349Sjillesreturn 4
16211349Sjillesecho bad
17211349Sjillesexit 1
18