svn commit: r305358 - in head: bin/cat/tests contrib/netbsd-tests contrib/netbsd-tests/bin/cat contrib/netbsd-tests/bin/sh contrib/netbsd-tests/bin/sh/dotcmd contrib/netbsd-tests/crypto/opencrypto ...

Ngie Cooper ngie at FreeBSD.org
Sat Sep 3 18:11:51 UTC 2016


Author: ngie
Date: Sat Sep  3 18:11:48 2016
New Revision: 305358
URL: https://svnweb.freebsd.org/changeset/base/305358

Log:
  Update contrib/netbsd-tests with new content from NetBSD
  
  This updates the snapshot from 09/30/2014 to 08/11/2016
  
  This brings in a number of new testcases from upstream, most
  notably:
  
  - bin/cat
  - lib/libc
  - lib/msun
  - lib/libthr
  - usr.bin/sort
  
  lib/libc/tests/stdio/open_memstream_test.c was moved to
  lib/libc/tests/stdio/open_memstream2_test.c to accomodate
  the new open_memstream test from NetBSD.
  
  MFC after:	2 months
  Tested on:	amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox
  Sponsored by:	EMC / Isilon Storage Division

Added:
  head/contrib/netbsd-tests/bin/cat/d_se_output.in
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.in
  head/contrib/netbsd-tests/bin/cat/d_se_output.out
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.out
  head/contrib/netbsd-tests/bin/sh/t_arith.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_arith.sh
  head/contrib/netbsd-tests/bin/sh/t_cmdsub.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_cmdsub.sh
  head/contrib/netbsd-tests/bin/sh/t_option.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_option.sh
  head/contrib/netbsd-tests/bin/sh/t_redir.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_redir.sh
  head/contrib/netbsd-tests/bin/sh/t_redircloexec.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_redircloexec.sh
  head/contrib/netbsd-tests/bin/sh/t_shift.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_shift.sh
  head/contrib/netbsd-tests/bin/sh/t_varval.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_varval.sh
  head/contrib/netbsd-tests/dev/fss/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/dev/fss/
  head/contrib/netbsd-tests/dev/usb/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/dev/usb/
  head/contrib/netbsd-tests/include/sys/t_pslist.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/include/sys/t_pslist.c
  head/contrib/netbsd-tests/kernel/kqueue/t_vnode.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/kernel/kqueue/t_vnode.c
  head/contrib/netbsd-tests/lib/libc/db/h_lfsr.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/db/h_lfsr.c
  head/contrib/netbsd-tests/lib/libc/db/t_db_hash_seq.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/db/t_db_hash_seq.c
  head/contrib/netbsd-tests/lib/libc/inet/t_inet_addr.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/inet/t_inet_addr.c
  head/contrib/netbsd-tests/lib/libc/stdio/t_open_memstream.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/stdio/t_open_memstream.c
  head/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c
  head/contrib/netbsd-tests/lib/libc/sync/cpp_atomic_ops_linkable.cc
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/sync/cpp_atomic_ops_linkable.cc
  head/contrib/netbsd-tests/lib/libc/sys/t_bind.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/sys/t_bind.c
  head/contrib/netbsd-tests/lib/libc/sys/t_getsockname.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/sys/t_getsockname.c
  head/contrib/netbsd-tests/lib/libc/sys/t_posix_fallocate.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/sys/t_posix_fallocate.c
  head/contrib/netbsd-tests/lib/libc/sys/t_wait.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/sys/t_wait.c
  head/contrib/netbsd-tests/lib/libm/t_fenv.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libm/t_fenv.c
  head/contrib/netbsd-tests/lib/libm/t_hypot.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libm/t_hypot.c
  head/contrib/netbsd-tests/lib/libusbhid/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libusbhid/
  head/contrib/netbsd-tests/net/arp/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/arp/
  head/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh
  head/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh
  head/contrib/netbsd-tests/net/if/ifconf.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if/ifconf.c
  head/contrib/netbsd-tests/net/if/t_ifconf.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if/t_ifconf.sh
  head/contrib/netbsd-tests/net/if/t_ifconfig.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if/t_ifconfig.sh
  head/contrib/netbsd-tests/net/if_gif/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if_gif/
  head/contrib/netbsd-tests/net/if_pppoe/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if_pppoe/
  head/contrib/netbsd-tests/net/if_tap/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if_tap/
  head/contrib/netbsd-tests/net/in_cksum/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/in_cksum/
  head/contrib/netbsd-tests/net/mcast/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/mcast/
  head/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh
  head/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh
  head/contrib/netbsd-tests/net/ndp/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/ndp/
  head/contrib/netbsd-tests/net/net/t_forwarding.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/net/t_forwarding.sh
  head/contrib/netbsd-tests/net/net/t_ipaddress.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/net/t_ipaddress.sh
  head/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh
  head/contrib/netbsd-tests/net/net/t_ipv6address.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/net/t_ipv6address.sh
  head/contrib/netbsd-tests/net/route/t_flags.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/route/t_flags.sh
  head/contrib/netbsd-tests/net/route/t_flags6.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/route/t_flags6.sh
  head/contrib/netbsd-tests/net/route/t_route.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/route/t_route.sh
  head/contrib/netbsd-tests/sbin/gpt/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sbin/gpt/
  head/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh
  head/contrib/netbsd-tests/sys/net/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sys/net/
  head/contrib/netbsd-tests/sys/netatalk/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sys/netatalk/
  head/contrib/netbsd-tests/sys/netinet/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sys/netinet/
  head/contrib/netbsd-tests/sys/netinet6/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sys/netinet6/
  head/contrib/netbsd-tests/usr.bin/config/d_min
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/config/d_min
  head/contrib/netbsd-tests/usr.bin/gdb/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/gdb/
  head/contrib/netbsd-tests/usr.bin/ld/
     - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/ld/
  head/contrib/netbsd-tests/usr.bin/netpgpverify/Testspec
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/netpgpverify/Testspec
  head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_struct.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_struct.c
  head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_compound_literal_comma.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_compound_literal_comma.c
  head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c
  head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_nested_struct.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_nested_struct.c
  head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init4.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init4.c
  head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_fun_array_param.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_fun_array_param.c
  head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_question_colon.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_question_colon.c
  head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typefun.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typefun.c
  head/lib/libc/tests/stdio/open_memstream2_test.c
     - copied unchanged from r305318, projects/netbsd-tests-update-12/lib/libc/tests/stdio/open_memstream2_test.c
Deleted:
  head/contrib/netbsd-tests/bin/sh/t_compexit.sh
  head/contrib/netbsd-tests/fs/nfs/nfsservice/mountd.c
  head/contrib/netbsd-tests/fs/nfs/nfsservice/nfsd.c
  head/lib/libc/tests/stdio/open_memstream_test.c
Modified:
  head/bin/cat/tests/Makefile
  head/contrib/netbsd-tests/bin/cat/d_align.in
  head/contrib/netbsd-tests/bin/cat/d_align.out
  head/contrib/netbsd-tests/bin/cat/t_cat.sh
  head/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command
  head/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh
  head/contrib/netbsd-tests/bin/sh/t_evaltested.sh
  head/contrib/netbsd-tests/bin/sh/t_exit.sh
  head/contrib/netbsd-tests/bin/sh/t_expand.sh
  head/contrib/netbsd-tests/bin/sh/t_fsplit.sh
  head/contrib/netbsd-tests/bin/sh/t_here.sh
  head/contrib/netbsd-tests/bin/sh/t_set_e.sh
  head/contrib/netbsd-tests/bin/sh/t_ulimit.sh
  head/contrib/netbsd-tests/bin/sh/t_varquote.sh
  head/contrib/netbsd-tests/bin/sh/t_wait.sh
  head/contrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh
  head/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue
  head/contrib/netbsd-tests/dev/dm/h_dm.c
  head/contrib/netbsd-tests/dev/sysmon/t_swsensor.sh
  head/contrib/netbsd-tests/dev/sysmon/t_swwdog.c
  head/contrib/netbsd-tests/fs/common/fstest_lfs.c
  head/contrib/netbsd-tests/fs/common/h_fsmacros.h
  head/contrib/netbsd-tests/fs/nfs/nfsservice/rumpnfsd.c
  head/contrib/netbsd-tests/fs/nfs/t_rquotad.sh
  head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh
  head/contrib/netbsd-tests/fs/vfs/t_io.c
  head/contrib/netbsd-tests/fs/vfs/t_renamerace.c
  head/contrib/netbsd-tests/fs/vfs/t_unpriv.c
  head/contrib/netbsd-tests/fs/vfs/t_vnops.c
  head/contrib/netbsd-tests/games/t_factor.sh
  head/contrib/netbsd-tests/h_macros.h
  head/contrib/netbsd-tests/include/sys/t_bitops.c
  head/contrib/netbsd-tests/include/sys/t_cdefs.c
  head/contrib/netbsd-tests/include/sys/t_socket.c
  head/contrib/netbsd-tests/include/t_paths.c
  head/contrib/netbsd-tests/ipf/expected/n14
  head/contrib/netbsd-tests/ipf/expected/n14_6
  head/contrib/netbsd-tests/ipf/t_filter_parse.sh
  head/contrib/netbsd-tests/ipf/t_nat_exec.sh
  head/contrib/netbsd-tests/kernel/kqueue/t_ioctl.c
  head/contrib/netbsd-tests/kernel/kqueue/t_proc1.c
  head/contrib/netbsd-tests/kernel/kqueue/t_proc2.c
  head/contrib/netbsd-tests/kernel/kqueue/t_proc3.c
  head/contrib/netbsd-tests/kernel/t_rnd.c
  head/contrib/netbsd-tests/lib/libbpfjit/t_bpfjit.c
  head/contrib/netbsd-tests/lib/libc/arch/ia64/return_one.S
  head/contrib/netbsd-tests/lib/libc/arch/powerpc/return_one.S
  head/contrib/netbsd-tests/lib/libc/arch/riscv/return_one.S
  head/contrib/netbsd-tests/lib/libc/db/t_db.sh
  head/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c
  head/contrib/netbsd-tests/lib/libc/gen/isqemu.h
  head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c
  head/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c
  head/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c
  head/contrib/netbsd-tests/lib/libc/gen/t_randomid.c
  head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c
  head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
  head/contrib/netbsd-tests/lib/libc/gen/t_time.c
  head/contrib/netbsd-tests/lib/libc/gen/t_vis.c
  head/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c
  head/contrib/netbsd-tests/lib/libc/net/t_servent.sh
  head/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c
  head/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
  head/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c
  head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
  head/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c
  head/contrib/netbsd-tests/lib/libc/string/t_memset.c
  head/contrib/netbsd-tests/lib/libc/sys/t_connect.c
  head/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c
  head/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
  head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
  head/contrib/netbsd-tests/lib/libc/sys/t_mmap.c
  head/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c
  head/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
  head/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c
  head/contrib/netbsd-tests/lib/libc/time/t_strptime.c
  head/contrib/netbsd-tests/lib/libcurses/director/testlang_parse.y
  head/contrib/netbsd-tests/lib/libm/t_exp.c
  head/contrib/netbsd-tests/lib/libm/t_fmod.c
  head/contrib/netbsd-tests/lib/libm/t_log.c
  head/contrib/netbsd-tests/lib/libm/t_pow.c
  head/contrib/netbsd-tests/lib/libpthread/t_cond.c
  head/contrib/netbsd-tests/lib/libpthread/t_mutex.c
  head/contrib/netbsd-tests/lib/libpthread/t_rwlock.c
  head/contrib/netbsd-tests/lib/librumpclient/t_exec.sh
  head/contrib/netbsd-tests/lib/librumpclient/t_fd.c
  head/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh
  head/contrib/netbsd-tests/lib/libutil/t_parsedate.c
  head/contrib/netbsd-tests/net/bpfilter/t_bpfilter.c
  head/contrib/netbsd-tests/net/bpfjit/t_bpfjit.c
  head/contrib/netbsd-tests/net/icmp/t_forward.c
  head/contrib/netbsd-tests/net/icmp/t_ping.c
  head/contrib/netbsd-tests/net/icmp/t_ping2.sh
  head/contrib/netbsd-tests/net/if_bridge/t_bridge.sh
  head/contrib/netbsd-tests/net/mpls/t_ldp_regen.sh
  head/contrib/netbsd-tests/net/mpls/t_mpls_fw.sh
  head/contrib/netbsd-tests/net/mpls/t_rfc4182.sh
  head/contrib/netbsd-tests/net/net/t_tcp.c
  head/contrib/netbsd-tests/net/route/t_change.sh
  head/contrib/netbsd-tests/rump/modautoload/t_modautoload.c
  head/contrib/netbsd-tests/rump/rumpkern/h_server/h_simpleserver.c
  head/contrib/netbsd-tests/rump/rumpkern/t_lwproc.c
  head/contrib/netbsd-tests/rump/rumpkern/t_sp.sh
  head/contrib/netbsd-tests/rump/rumpnet/t_shmif.sh
  head/contrib/netbsd-tests/rump/rumpvfs/t_p2kifs.c
  head/contrib/netbsd-tests/sbin/resize_ffs/common.sh
  head/contrib/netbsd-tests/sbin/resize_ffs/t_grow.sh
  head/contrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh
  head/contrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh
  head/contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh
  head/contrib/netbsd-tests/sbin/sysctl/t_perm.sh
  head/contrib/netbsd-tests/share/mk/t_lib.sh
  head/contrib/netbsd-tests/share/mk/t_prog.sh
  head/contrib/netbsd-tests/share/mk/t_test.sh
  head/contrib/netbsd-tests/usr.bin/cc/t_hello.sh
  head/contrib/netbsd-tests/usr.bin/config/support/conf/files
  head/contrib/netbsd-tests/usr.bin/config/t_config.sh
  head/contrib/netbsd-tests/usr.bin/make/t_make.sh
  head/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh
  head/contrib/netbsd-tests/usr.bin/sed/t_sed.sh
  head/contrib/netbsd-tests/usr.bin/sort/d_any_char_dflag_out.txt   (contents, props changed)
  head/contrib/netbsd-tests/usr.bin/sort/d_any_char_fflag_out.txt   (contents, props changed)
  head/contrib/netbsd-tests/usr.bin/sort/d_any_char_iflag_out.txt   (contents, props changed)
  head/contrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh
  head/lib/libc/tests/db/Makefile
  head/lib/libc/tests/hash/Makefile
  head/lib/libc/tests/inet/Makefile
  head/lib/libc/tests/stdio/Makefile
  head/lib/libc/tests/stdlib/Makefile
  head/lib/libc/tests/sys/Makefile
  head/lib/msun/tests/Makefile
Directory Properties:
  head/   (props changed)
  head/contrib/netbsd-tests/   (props changed)

Modified: head/bin/cat/tests/Makefile
==============================================================================
--- head/bin/cat/tests/Makefile	Sat Sep  3 17:59:46 2016	(r305357)
+++ head/bin/cat/tests/Makefile	Sat Sep  3 18:11:48 2016	(r305358)
@@ -6,7 +6,15 @@ NETBSD_ATF_TESTS_SH=		cat_test
 
 ${PACKAGE}FILES+=		d_align.in
 ${PACKAGE}FILES+=		d_align.out
+${PACKAGE}FILES+=		d_se_output.in
+${PACKAGE}FILES+=		d_se_output.out
 
 .include <netbsd-tests.test.mk>
 
+d_align.out: ${TESTSRC}/d_align.out
+	sed -E -e 's,^[[:space:]]{7}\$$$$,\$$,' < ${.ALLSRC} > ${.TARGET}.tmp
+	mv ${.TARGET}.tmp ${.TARGET}
+
+CLEANFILES+=			d_align.out d_align.out.tmp
+
 .include <bsd.test.mk>

Modified: head/contrib/netbsd-tests/bin/cat/d_align.in
==============================================================================
--- head/contrib/netbsd-tests/bin/cat/d_align.in	Sat Sep  3 17:59:46 2016	(r305357)
+++ head/contrib/netbsd-tests/bin/cat/d_align.in	Sat Sep  3 18:11:48 2016	(r305358)
@@ -1,3 +1,5 @@
 a b c
+
 1 2 3
+
 x y z

Modified: head/contrib/netbsd-tests/bin/cat/d_align.out
==============================================================================
--- head/contrib/netbsd-tests/bin/cat/d_align.out	Sat Sep  3 17:59:46 2016	(r305357)
+++ head/contrib/netbsd-tests/bin/cat/d_align.out	Sat Sep  3 18:11:48 2016	(r305358)
@@ -1,3 +1,5 @@
      1	a b c$
+      	$
      2	1 2 3$
+      	$
      3	x y z$

Copied: head/contrib/netbsd-tests/bin/cat/d_se_output.in (from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.in)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/netbsd-tests/bin/cat/d_se_output.in	Sat Sep  3 18:11:48 2016	(r305358, copy of r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.in)
@@ -0,0 +1,3 @@
+
+Of course it runs NetBSD
+

Copied: head/contrib/netbsd-tests/bin/cat/d_se_output.out (from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.out)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/netbsd-tests/bin/cat/d_se_output.out	Sat Sep  3 18:11:48 2016	(r305358, copy of r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.out)
@@ -0,0 +1,3 @@
+$
+Of course it runs NetBSD$
+$

Modified: head/contrib/netbsd-tests/bin/cat/t_cat.sh
==============================================================================
--- head/contrib/netbsd-tests/bin/cat/t_cat.sh	Sat Sep  3 17:59:46 2016	(r305357)
+++ head/contrib/netbsd-tests/bin/cat/t_cat.sh	Sat Sep  3 18:11:48 2016	(r305358)
@@ -1,4 +1,4 @@
-# $NetBSD: t_cat.sh,v 1.2 2012/03/27 17:57:02 jruoho Exp $
+# $NetBSD: t_cat.sh,v 1.3 2016/06/16 01:04:58 sevan Exp $
 #
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -52,8 +52,20 @@ nonexistent_body() {
 		-x "cat /some/name/that/does/not/exist"
 }
 
+atf_test_case se_output
+se_output_head() {
+	atf_set "descr" "Test that cat(1) prints a $ sign " \
+			"on blank lines with options '-se' (PR bin/51250)"
+}
+
+se_output_body() {
+	atf_check -s ignore -o file:$(atf_get_srcdir)/d_se_output.out \
+		-x "cat -se $(atf_get_srcdir)/d_se_output.in"
+}
+
 atf_init_test_cases()
 {
 	atf_add_test_case align
 	atf_add_test_case nonexistent
+	atf_add_test_case se_output
 }

Modified: head/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command
==============================================================================
--- head/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command	Sat Sep  3 17:59:46 2016	(r305357)
+++ head/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command	Sat Sep  3 18:11:48 2016	(r305358)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: scoped_command,v 1.1 2014/05/31 14:29:06 christos Exp $
+# $NetBSD: scoped_command,v 1.2 2016/03/27 14:57:50 christos Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -30,6 +30,27 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
+: ${TEST_SH:=/bin/sh}
+
+sane_sh()
+{
+	set -- ${TEST_SH}
+	case "$#" in
+	(0)   set /bin/sh;;
+	(1|2) ;;
+	(*)   set "$1";;   # Just ignore options if we cannot make them work
+	esac
+
+	case "$1" in
+	/*)	TEST_SH="$1${2+ }$2";;
+	./*)	TEST_SH="${PWD}${1#.}${2+ }$2";;
+	*/*)	TEST_SH="${PWD}/$1${2+ }$2";;
+	*)	TEST_SH="$( command -v "$1" )${2+ }$2";;
+	esac
+}
+
+sane_sh
+
 set -e
 
 # USAGE:
@@ -52,7 +73,7 @@ cmd="echo 'before ${3}'
 ${2}
 echo 'after ${3}, return value:' ${?}"
 
-echo "#!/bin/sh"
+echo "#!${TEST_SH}"
 
 [ 'func' = "${1}" ] && cat <<EOF
 func()

Modified: head/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh
==============================================================================
--- head/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh	Sat Sep  3 17:59:46 2016	(r305357)
+++ head/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh	Sat Sep  3 18:11:48 2016	(r305358)
@@ -1,4 +1,4 @@
-# $NetBSD: t_dotcmd.sh,v 1.1 2014/05/31 14:29:06 christos Exp $
+# $NetBSD: t_dotcmd.sh,v 1.2 2016/03/27 14:57:50 christos Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -33,6 +33,10 @@
 # in C/C++ so, for example, if the dotcmd is in a loop's body, a break in
 # the sourced file can be used to break out of that loop.
 
+# Note that the standard does not require this, and allows lexically
+# scoped interpretation of break/continue (and permits dynamic scope
+# as an optional extension.)
+
 cmds='return break continue'
 scopes='case compound file for func subshell until while'
 

Copied: head/contrib/netbsd-tests/bin/sh/t_arith.sh (from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_arith.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/netbsd-tests/bin/sh/t_arith.sh	Sat Sep  3 18:11:48 2016	(r305358, copy of r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_arith.sh)
@@ -0,0 +1,1035 @@
+# $NetBSD: t_arith.sh,v 1.5 2016/05/12 14:25:11 kre Exp $
+#
+# Copyright (c) 2016 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# the implementation of "sh" to test
+: ${TEST_SH:="/bin/sh"}
+
+# Requirement is to support at least "signed long" whatever that means
+# (number of bits in "long" is not specified - but should be at least 32).
+
+# These tests use -o inline:"..." rather than -o match:'...' as we have
+# only digits to examine, and it is good to be sure that 1 + 1 really gives 2
+# and that 42 or 123 don't look like success because there is a 2 in them.
+
+ARITH_BITS='?'
+discover_range()
+{
+	# cannot use arithmetic "test" operators, range of test in
+	# ATF_SHELL (or even TEST_SH) might not be as big as that
+	# supported by $(( )) in TEST_SH
+
+	if ! ${TEST_SH} -c ': $(( 0x10000 ))' 2>/dev/null
+	then
+		# 16 bits or less, or hex unsupported, just give up...
+		return
+	fi
+	test $( ${TEST_SH} -c 'echo $(( 0x1FFFF ))' ) = 131071 || return
+
+	# when attempting to exceed the number of available bits
+	# the shell may react in any of 3 (rational) ways
+	# 1. syntax error (maybe even core dump...) and fail
+	# 2. represent a positive number input as negative value
+	# 3. keep the number positive, but not the value expected
+	#    (perhaps pegged at the max possible value)
+	# any of those may be accompanied by a message to stderr
+
+	# Must check all 3 possibilities for each plausible size
+	# Tests do not use 0x8000... because that value can have weird
+	# other side effects that are not relevant to discover here.
+	# But we do want to try and force the sign bit set.
+
+	if ! ${TEST_SH} -c ': $(( 0xC0000000 ))' 2>/dev/null
+	then
+		# proobably shell detected overflow and complained
+		ARITH_BITS=32
+		return
+	fi
+	if ${TEST_SH} 2>/dev/null \
+	    -c 'case $(( 0xC0000000 )); in (-*) exit 0;; esac; exit 1'
+	then
+		ARITH_BITS=32
+		return
+	fi
+	if ${TEST_SH} -c '[ $(( 0xC0000000 )) != 3221225472 ]' 2>/dev/null
+	then
+		ARITH_BITS=32
+		return
+	fi
+
+	if ! ${TEST_SH} -c ': $(( 0xC000000000000000 ))' 2>/dev/null
+	then
+		ARITH_BITS=64
+		return
+	fi
+	if ${TEST_SH} 2>/dev/null \
+	    -c 'case $(( 0xC000000000000000 )); in (-*) exit 0;; esac; exit 1'
+	then
+		ARITH_BITS=64
+		return
+	fi
+	if ${TEST_SH} 2>/dev/null \
+	    -c '[ $((0xC000000000000000)) != 13835058055282163712 ]'
+	then
+		ARITH_BITS=64
+		return
+	fi
+
+	if ${TEST_SH} 2>/dev/null -c \
+	   '[ $((0x123456781234567812345678)) = 5634002657842756053938493048 ]'
+	then
+		# just assume... (for now anyway, revisit when it happens...)
+		ARITH_BITS=96
+		return
+	fi
+}
+
+atf_test_case constants
+constants_head()
+{
+        atf_set "descr" "Tests that arithmetic expansion can handle constants"
+}
+constants_body()
+{
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $((0x0))'
+
+	# atf_expect_fail "PR bin/50959"
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $((0X0))'
+	# atf_expect_pass
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $((000))'
+
+	atf_check -s exit:0 -o inline:'1\n' -e empty \
+		${TEST_SH} -c 'echo $(( 000000001 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty \
+		${TEST_SH} -c 'echo $(( 0x000000 ))'
+
+	atf_check -s exit:0 -o inline:'99999\n' -e empty \
+		${TEST_SH} -c 'echo $((99999))'
+
+	[ ${ARITH_BITS} -gt 44 ] &&
+		atf_check -s exit:0 -o inline:'9191919191919\n' -e empty \
+			${TEST_SH} -c 'echo $((9191919191919))'
+
+	atf_check -s exit:0 -o inline:'13\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xD ))'
+	atf_check -s exit:0 -o inline:'11\n' -e empty ${TEST_SH} -c \
+		'echo $(( 013 ))'
+	atf_check -s exit:0 -o inline:'7\n' -e empty ${TEST_SH} -c \
+		'x=7;echo $(($x))'
+	atf_check -s exit:0 -o inline:'9\n' -e empty ${TEST_SH} -c \
+		'x=9;echo $((x))'
+
+	atf_check -s exit:0 -o inline:'11\n' -e empty \
+		${TEST_SH} -c 'x=0xB; echo $(( $x ))'
+	atf_check -s exit:0 -o inline:'27\n' -e empty \
+		${TEST_SH} -c 'x=0X1B; echo $(( x ))'
+	atf_check -s exit:0 -o inline:'27\n' -e empty \
+		${TEST_SH} -c 'X=033; echo $(( $X ))'
+	atf_check -s exit:0 -o inline:'219\n' -e empty \
+		${TEST_SH} -c 'X=0333; echo $(( X ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty \
+		${TEST_SH} -c 'NULL=; echo $(( NULL ))'
+
+	# Not clear if this is 0, nothing, or an error, so omit for now
+	# atf_check -s exit:0 -o inline:'0\n' -e empty \
+	# 	${TEST_SH} -c 'echo $(( ))'
+
+	# not clear whether this should return 0 or an error, so omit for now
+	# atf_check -s exit:0 -o inline:'0\n' -e empty \
+	# 	${TEST_SH} -c 'echo $(( UNDEFINED_VAR ))'
+}
+
+
+atf_test_case do_unary_plus
+do_unary_plus_head()
+{
+        atf_set "descr" "Tests that unary plus works as expected"
+}
+do_unary_plus_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( +0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( +1 ))'
+	atf_check -s exit:0 -o inline:'6\n' -e empty ${TEST_SH} -c \
+		'echo $(( + 6 ))'
+	atf_check -s exit:0 -o inline:'4321\n' -e empty ${TEST_SH} -c \
+		'echo $(( + 4321 ))'
+	atf_check -s exit:0 -o inline:'17185\n' -e empty ${TEST_SH} -c \
+		'echo $(( + 0x4321 ))'
+}
+
+atf_test_case do_unary_minus
+do_unary_minus_head()
+{
+        atf_set "descr" "Tests that unary minus works as expected"
+}
+do_unary_minus_body()
+{
+	atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \
+		'echo $(( -1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( - 0 ))'
+	atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \
+		'echo $(( - 1 ))'
+	atf_check -s exit:0 -o inline:'-6\n' -e empty ${TEST_SH} -c \
+		'echo $(( - 6 ))'
+	atf_check -s exit:0 -o inline:'-4321\n' -e empty ${TEST_SH} -c \
+		'echo $(( - 4321 ))'
+	atf_check -s exit:0 -o inline:'-2257\n' -e empty ${TEST_SH} -c \
+		'echo $(( - 04321 ))'
+	atf_check -s exit:0 -o inline:'-7\n' -e empty ${TEST_SH} -c \
+		'echo $((-7))'
+}
+
+atf_test_case do_unary_not
+do_unary_not_head()
+{
+        atf_set "descr" "Tests that unary not (boolean) works as expected"
+}
+do_unary_not_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( ! 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( ! 0 ))'
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( !1234 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( !0xFFFF ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( ! 000000 ))'
+}
+
+atf_test_case do_unary_tilde
+do_unary_tilde_head()
+{
+        atf_set "descr" "Tests that unary not (bitwise) works as expected"
+}
+do_unary_tilde_body()
+{
+	# definitely 2's complement arithmetic here...
+
+	atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \
+		'echo $(( ~ 0 ))'
+	atf_check -s exit:0 -o inline:'-2\n' -e empty ${TEST_SH} -c \
+		'echo $(( ~ 1 ))'
+
+	atf_check -s exit:0 -o inline:'-1235\n' -e empty ${TEST_SH} -c \
+		'echo $(( ~1234 ))'
+	atf_check -s exit:0 -o inline:'-256\n' -e empty ${TEST_SH} -c \
+		'echo $(( ~0xFF ))'
+}
+
+atf_test_case elementary_add
+elementary_add_head()
+{
+        atf_set "descr" "Tests that simple addition works as expected"
+}
+elementary_add_body()
+{
+	# some of these tests actually test unary ops &  op precedence...
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 + 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 + 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 + 1 ))'
+	atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 + 1 ))'
+	atf_check -s exit:0 -o inline:'10\n' -e empty ${TEST_SH} -c \
+		'echo $(( 4 + 6 ))'
+	atf_check -s exit:0 -o inline:'10\n' -e empty ${TEST_SH} -c \
+		'echo $(( 6 + 4 ))'
+	atf_check -s exit:0 -o inline:'5555\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1234 + 4321 ))'
+	atf_check -s exit:0 -o inline:'3333\n' -e empty ${TEST_SH} -c \
+		'echo $((1111+2222))'
+	atf_check -s exit:0 -o inline:'5555\n' -e empty ${TEST_SH} -c \
+		'echo $((+3333+2222))'
+	atf_check -s exit:0 -o inline:'7777\n' -e empty ${TEST_SH} -c \
+		'echo $((+3333 + +4444))'
+	atf_check -s exit:0 -o inline:'-7777\n' -e empty ${TEST_SH} -c \
+		'echo -$((+4125+ +3652))'
+}
+
+atf_test_case elementary_sub
+elementary_sub_head()
+{
+        atf_set "descr" "Tests that simple subtraction works as expected"
+}
+elementary_sub_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 - 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 - 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 - 1 ))'
+	atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 - 1 ))'
+	atf_check -s exit:0 -o inline:'488\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1066 - 578 ))'
+	atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2016-5678 ))'
+	atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2016+-5678 ))'
+	atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2016-+5678 ))'
+	atf_check -s exit:0 -o inline:'-7694\n' -e empty ${TEST_SH} -c \
+		'echo $(( -2016-5678 ))'
+	atf_check -s exit:0 -o inline:'--1\n' -e empty ${TEST_SH} -c \
+		'echo -$(( -1018 - -1017 ))'
+}
+
+atf_test_case elementary_mul
+elementary_mul_head()
+{
+        atf_set "descr" "Tests that simple multiplication works as expected"
+}
+elementary_mul_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 * 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 * 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 * 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 * 1 ))'
+	atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \
+		'echo $(( -1 * 1 ))'
+	atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 * -1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( -1 * -1 ))'
+	atf_check -s exit:0 -o inline:'391\n' -e empty ${TEST_SH} -c \
+		'echo $(( 17 * 23 ))'
+	atf_check -s exit:0 -o inline:'169\n' -e empty ${TEST_SH} -c \
+		'echo $(( 13*13 ))'
+	atf_check -s exit:0 -o inline:'-11264\n' -e empty ${TEST_SH} -c \
+		'echo $(( -11 *1024 ))'
+	atf_check -s exit:0 -o inline:'-16983\n' -e empty ${TEST_SH} -c \
+		'echo $(( 17* -999 ))'
+	atf_check -s exit:0 -o inline:'9309\n' -e empty ${TEST_SH} -c \
+		'echo $(( -29*-321 ))'
+}
+
+atf_test_case elementary_div
+elementary_div_head()
+{
+        atf_set "descr" "Tests that simple division works as expected"
+}
+elementary_div_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 / 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 / 1 ))'
+	test ${ARITH_BITS} -ge 38 &&
+	    atf_check -s exit:0 -o inline:'99999999999\n' -e empty \
+		${TEST_SH} -c 'echo $(( 99999999999 / 1 ))'
+	atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2 / 1 ))'
+
+	atf_check -s exit:0 -o inline:'3\n' -e empty ${TEST_SH} -c \
+		'echo $(( 3 / 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 3 / 2 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 3 / 3 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 3 / 4 ))'
+
+	atf_check -s exit:0 -o inline:'173\n' -e empty ${TEST_SH} -c \
+		'echo $(( 123456 / 713 ))'
+	atf_check -s exit:0 -o inline:'13\n' -e empty ${TEST_SH} -c \
+		'echo $(( 169 / 13 ))'
+}
+
+atf_test_case elementary_rem
+elementary_rem_head()
+{
+        atf_set "descr" "Tests that simple modulus works as expected"
+}
+elementary_rem_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 % 1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 % 1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2 % 1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 9999 % 1 ))'
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 % 2 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 % 2 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2 % 2 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xFFFF % 2 ))'
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 % 3 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 % 3 ))'
+	atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2 % 3 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 3 % 3 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 3123 % 3 ))'
+
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 9999 % 2 ))'
+
+	atf_check -s exit:0 -o inline:'107\n' -e empty ${TEST_SH} -c \
+		'echo $(( 123456%173 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $((169%13))'
+}
+
+atf_test_case elementary_shl
+elementary_shl_head()
+{
+        atf_set "descr" "Tests that simple shift left works as expected"
+}
+elementary_shl_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 << 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 << 1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 << 17 ))'
+
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 << 0 ))'
+	atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 << 1 ))'
+	atf_check -s exit:0 -o inline:'131072\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 << 17 ))'
+
+	atf_check -s exit:0 -o inline:'2021161080\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x3C3C3C3C << 1 ))'
+
+	test "${ARITH_BITS}" -ge 40 &&
+	    atf_check -s exit:0 -o inline:'129354309120\n' -e empty \
+		${TEST_SH} -c 'echo $(( 0x3C3C3C3C << 7 ))'
+	test "${ARITH_BITS}" -ge 72 &&
+	    atf_check -s exit:0 -o inline:'1111145054534149079040\n' \
+		-e empty ${TEST_SH} -c 'echo $(( 0x3C3C3C3C << 40 ))'
+
+	return 0
+}
+
+atf_test_case elementary_shr
+elementary_shr_head()
+{
+        atf_set "descr" "Tests that simple shift right works as expected"
+}
+elementary_shr_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 >> 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 >> 1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 >> 17 ))'
+
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 >> 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 >> 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2 >> 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 3 >> 1 ))'
+
+	atf_check -s exit:0 -o inline:'4\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x10 >> 2 ))'
+	atf_check -s exit:0 -o inline:'4\n' -e empty ${TEST_SH} -c \
+		'echo $(( 022 >> 2 ))'
+
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 131072 >> 17 ))'
+
+	test ${ARITH_BITS} -ge 40 &&
+		atf_check -s exit:0 -o inline:'8\n' -e empty ${TEST_SH} -c \
+			'echo $(( 0x4000000000 >> 35 ))'
+	test ${ARITH_BITS} -ge 80 &&
+		atf_check -s exit:0 -o inline:'4464\n' -e empty ${TEST_SH} -c \
+			'echo $(( 0x93400FACE005C871000 >> 64 ))'
+
+	return 0
+}
+
+atf_test_case elementary_eq
+elementary_eq_head()
+{
+        atf_set "descr" "Tests that simple equality test works as expected"
+}
+elementary_eq_body()
+{
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 == 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 == 0000 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 == 0x00 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 == 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'X=30; Y=0x1E; echo $(( X == Y ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x1234 == 4660 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x1234 == 011064 ))'
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 == 1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 == 0000000000000001 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 == 0x10000000000000 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 == 2 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'X=3; Y=7; echo $(( X == Y ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1234 == 0x4660 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 01234 == 0x11064 ))'
+}
+atf_test_case elementary_ne
+elementary_ne_head()
+{
+        atf_set "descr" "Tests that simple inequality test works as expected"
+}
+elementary_ne_body()
+{
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 != 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x71 != 17 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1234 != 01234 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x1234 != 01234 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'X=3; echo $(( X != 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'X=3; Y=0x11; echo $(( X != Y ))'
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 3 != 3 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 != 0x0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xA != 012 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'X=1; echo $(( X != 1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'X=0xC; Y=014; echo $(( X != Y ))'
+}
+atf_test_case elementary_lt
+elementary_lt_head()
+{
+        atf_set "descr" "Tests that simple less than test works as expected"
+}
+elementary_lt_body()
+{
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 < 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( -1 < 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 < 10 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 100 < 101 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xA1 < 200 ))'
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 < 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 < 0 ))'
+
+	test ${ARITH_BITS} -ge 40 &&
+	    atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x1BEEFF00D < 0x1FACECAFE ))'
+
+	return 0
+}
+atf_test_case elementary_le
+elementary_le_head()
+{
+        atf_set "descr" "Tests that simple less or equal test works as expected"
+}
+elementary_le_body()
+{
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 <= 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( -1 <= 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 <= 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 <= 10 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 100 <= 101 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xA1 <= 161 ))'
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 <= 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( -100 <= -200 ))'
+
+	test ${ARITH_BITS} -ge 40 &&
+	    atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'cost=; AUD=; echo $(( $cost 0x2FEEDBABE <= $AUD 12866927294 ))'
+
+	return 0
+}
+atf_test_case elementary_gt
+elementary_gt_head()
+{
+        atf_set "descr" "Tests that simple greater than works as expected"
+}
+elementary_gt_body()
+{
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 > 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 > -1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 11 > 012 ))'
+
+	# atf_expect_fail "PR bin/50959"
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2147483647 > 0X7FFFFF0 ))'
+	# atf_expect_pass
+
+	test ${ARITH_BITS} -gt 32 &&
+	    atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x80000000 > 0x7FFFFFFF ))'
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 > 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 > 1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( -1 > 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 > 10 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2015 > 2016 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xA1 > 200 ))'
+
+	test ${ARITH_BITS} -ge 44 &&
+	    atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x7F07F07F0 > 34099628014 ))'
+
+	return 0
+}
+atf_test_case elementary_ge
+elementary_ge_head()
+{
+        atf_set "descr" "Tests that simple greater or equal works as expected"
+}
+elementary_ge_body()
+{
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 >= 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 >= 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( -100 >= -101 ))'
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( -1 >= 0 ))'
+}
+
+atf_test_case fiddle_bits_and
+fiddle_bits_and_head()
+{
+	atf_set "descr" "Test bitwise and operations in arithmetic expressions"
+}
+fiddle_bits_and_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 & 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 & 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 & 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 & 1 ))'
+
+	atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xFF & 0xFF ))'
+	atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xFFFF & 0377 ))'
+
+	test "${ARITH_BITS}" -ge 48 &&
+	    atf_check -s exit:0 -o inline:'70377641607203\n' -e empty \
+		${TEST_SH} -c 'echo $(( 0x5432FEDC0123 & 0x42871357BAB3 ))'
+
+	return 0
+}
+atf_test_case fiddle_bits_or
+fiddle_bits_or_head()
+{
+	atf_set "descr" "Test bitwise or operations in arithmetic expressions"
+}
+fiddle_bits_or_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 | 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 | 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 | 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 | 1 ))'
+
+	atf_check -s exit:0 -o inline:'4369\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x1111 | 0x1111 ))'
+	atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xAA | 0125 ))'
+
+	test "${ARITH_BITS}" -ge 48 &&
+	    atf_check -s exit:0 -o inline:'95348271856563\n' -e empty \
+		${TEST_SH} -c 'echo $(( 0x5432FEDC0123 | 0x42871357BAB3 ))'
+
+	return 0
+}
+atf_test_case fiddle_bits_xor
+fiddle_bits_xor_head()
+{
+	atf_set "descr" "Test bitwise xor operations in arithmetic expressions"
+}
+fiddle_bits_xor_body()
+{
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 ^ 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 ^ 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 ^ 1 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 ^ 1 ))'
+
+	atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xF0 ^ 0x0F ))'
+	atf_check -s exit:0 -o inline:'15\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xF0 ^ 0xFF ))'
+
+	test "${ARITH_BITS}" -ge 48 &&
+	    atf_check -s exit:0 -o inline:'24970630249360\n' -e empty \
+		${TEST_SH} -c 'echo $(( 0x5432FEDC0123 ^ 0x42871357BAB3 ))'
+
+	return 0
+}
+
+atf_test_case logical_and
+logical_and_head()
+{
+	atf_set "descr" "Test logical and operations in arithmetic expressions"
+}
+logical_and_body()
+{
+	# cannot test short-circuit eval until sh implements side effects...
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 && 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 && 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 && 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 && 1 ))'
+
+	# atf_expect_fail "PR bin/50960"
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x1111 && 01234 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0xFFFF && 0xF0F0 ))'
+}
+atf_test_case logical_or
+logical_or_head()
+{
+	atf_set "descr" "Test logical or operations in arithmetic expressions"
+}
+logical_or_body()
+{
+	# cannot test short-circuit eval until sh implements side effects...
+
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 || 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 || 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 || 1 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 || 1 ))'
+
+	# atf_expect_fail "PR bin/50960"
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x1111 || 01234 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x33 || 0xF0F0 ))'
+}
+
+atf_test_case make_selection
+make_selection_head()
+{
+	atf_set "descr" "Test ?: operator in arithmetic expressions"
+}
+make_selection_body()
+{
+	# atf_expect_fail "PR bin/50958"
+
+	atf_check -s exit:0 -o inline:'3\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0 ? 2 : 3 ))'
+	atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 ? 2 : 3 ))'
+
+	atf_check -s exit:0 -o inline:'111\n' -e empty ${TEST_SH} -c \
+		'echo $(( 0x1234 ? 111 : 222 ))'
+
+	atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 < 2 ? -1 : 1 > 2 ? 1 : 0 ))'
+	atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 < 1 ? -1 : 1 > 1 ? 1 : 0 ))'
+	atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \
+		'echo $(( 2 < 1 ? -1 : 2 > 1 ? 1 : 0 ))'
+}
+
+atf_test_case operator_precedence
+operator_precedence_head()
+{
+	atf_set "descr" "Test operator precedence without parentheses"
+}
+operator_precedence_body()
+{
+	# NB: apart from $(( ))  ** NO ** parentheses in the expressions.
+
+	atf_check -s exit:0 -o inline:'6\n' -e empty ${TEST_SH} -c \
+		'echo $(( 1 + 2 + 3 ))'

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-all mailing list