t_setjmp.sh revision 1.1
11.1Sriastrad#	$NetBSD: t_setjmp.sh,v 1.1 2025/04/27 16:22:26 riastradh Exp $
21.1Sriastrad#
31.1Sriastrad# Copyright (c) 2025 The NetBSD Foundation, Inc.
41.1Sriastrad# All rights reserved.
51.1Sriastrad#
61.1Sriastrad# Redistribution and use in source and binary forms, with or without
71.1Sriastrad# modification, are permitted provided that the following conditions
81.1Sriastrad# are met:
91.1Sriastrad# 1. Redistributions of source code must retain the above copyright
101.1Sriastrad#    notice, this list of conditions and the following disclaimer.
111.1Sriastrad# 2. Redistributions in binary form must reproduce the above copyright
121.1Sriastrad#    notice, this list of conditions and the following disclaimer in the
131.1Sriastrad#    documentation and/or other materials provided with the distribution.
141.1Sriastrad#
151.1Sriastrad# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
161.1Sriastrad# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
171.1Sriastrad# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
181.1Sriastrad# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
191.1Sriastrad# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
201.1Sriastrad# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
211.1Sriastrad# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
221.1Sriastrad# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
231.1Sriastrad# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
241.1Sriastrad# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
251.1Sriastrad# POSSIBILITY OF SUCH DAMAGE.
261.1Sriastrad#
271.1Sriastrad
281.1Sriastradatf_test_case setjmp cleanup
291.1Sriastradsetjmp_head()
301.1Sriastrad{
311.1Sriastrad	atf_set "descr" "Test setjmp(9)/longjmp(9)"
321.1Sriastrad}
331.1Sriastradsetjmp_body()
341.1Sriastrad{
351.1Sriastrad	case `uname -p` in
361.1Sriastrad	powerpc*)
371.1Sriastrad		atf_expect_fail "PR port-powerpc/59306:" \
381.1Sriastrad		    " kernel longjmp(9) fails to make setjmp(9) return 1"
391.1Sriastrad		;;
401.1Sriastrad	sparc*)
411.1Sriastrad		atf_expect_fail "PR port-sparc/59307:" \
421.1Sriastrad		    " kernel longjmp(9) fails to make setjmp(9) return 1"
431.1Sriastrad		;;
441.1Sriastrad	vax)
451.1Sriastrad		atf_expect_fail "PR port-vax/59308:" \
461.1Sriastrad		    " kernel longjmp(9) fails to make setjmp(9) return 1"
471.1Sriastrad		;;
481.1Sriastrad	esac
491.1Sriastrad
501.1Sriastrad	modload "$(atf_get_srcdir)/setjmp_tester/setjmp_tester.kmod"
511.1Sriastrad	atf_check -s exit:0 -o inline:'1\n' \
521.1Sriastrad	    sysctl -n -w kern.setjmp_tester.test=1
531.1Sriastrad}
541.1Sriastradsetjmp_cleanup()
551.1Sriastrad{
561.1Sriastrad	modunload setjmp_tester
571.1Sriastrad}
581.1Sriastrad
591.1Sriastradatf_init_test_cases()
601.1Sriastrad{
611.1Sriastrad	atf_add_test_case setjmp
621.1Sriastrad}
63