Index: head/bin/sh/shell.h =================================================================== --- head/bin/sh/shell.h (revision 342879) +++ head/bin/sh/shell.h (revision 342880) @@ -1,79 +1,78 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Kenneth Almquist. * * 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. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. * * @(#)shell.h 8.2 (Berkeley) 5/4/95 * $FreeBSD$ */ #ifndef SHELL_H_ #define SHELL_H_ #include /* * The follow should be set to reflect the type of system you have: * JOBS -> 1 if you have Berkeley job control, 0 otherwise. * define DEBUG=1 to compile in debugging (set global "debug" to turn on) * define DEBUG=2 to compile in and turn on debugging. * * When debugging is on, debugging info will be written to ./trace and * a quit signal will generate a core dump. */ #define JOBS 1 /* #define DEBUG 1 */ /* * Type of used arithmetics. SUSv3 requires us to have at least signed long. */ typedef intmax_t arith_t; #define ARITH_FORMAT_STR "%" PRIdMAX -#define atoarith_t(arg) strtoimax(arg, NULL, 0) -#define strtoarith_t(nptr, endptr, base) strtoimax(nptr, endptr, base) +#define strtoarith_t(nptr, endptr, base) (intmax_t)strtoumax(nptr, endptr, base) #define ARITH_MIN INTMAX_MIN #define ARITH_MAX INTMAX_MAX typedef void *pointer; #include extern char nullstr[1]; /* null string */ #ifdef DEBUG #define TRACE(param) sh_trace param #else #define TRACE(param) #endif #endif /* !SHELL_H_ */ Index: head/bin/sh/tests/expansion/Makefile =================================================================== --- head/bin/sh/tests/expansion/Makefile (revision 342879) +++ head/bin/sh/tests/expansion/Makefile (revision 342880) @@ -1,109 +1,110 @@ # $FreeBSD$ PACKAGE= tests TESTSDIR= ${TESTSBASE}/bin/sh/${.CURDIR:T} .PATH: ${.CURDIR:H} ATF_TESTS_SH= functional_test ${PACKAGE}FILES+= arith1.0 ${PACKAGE}FILES+= arith2.0 ${PACKAGE}FILES+= arith3.0 ${PACKAGE}FILES+= arith4.0 ${PACKAGE}FILES+= arith5.0 ${PACKAGE}FILES+= arith6.0 ${PACKAGE}FILES+= arith7.0 ${PACKAGE}FILES+= arith8.0 ${PACKAGE}FILES+= arith9.0 ${PACKAGE}FILES+= arith10.0 ${PACKAGE}FILES+= arith11.0 ${PACKAGE}FILES+= arith12.0 ${PACKAGE}FILES+= arith13.0 ${PACKAGE}FILES+= arith14.0 +${PACKAGE}FILES+= arith15.0 ${PACKAGE}FILES+= assign1.0 ${PACKAGE}FILES+= cmdsubst1.0 ${PACKAGE}FILES+= cmdsubst2.0 ${PACKAGE}FILES+= cmdsubst3.0 ${PACKAGE}FILES+= cmdsubst4.0 ${PACKAGE}FILES+= cmdsubst5.0 ${PACKAGE}FILES+= cmdsubst6.0 ${PACKAGE}FILES+= cmdsubst7.0 ${PACKAGE}FILES+= cmdsubst8.0 ${PACKAGE}FILES+= cmdsubst9.0 ${PACKAGE}FILES+= cmdsubst10.0 ${PACKAGE}FILES+= cmdsubst11.0 ${PACKAGE}FILES+= cmdsubst12.0 ${PACKAGE}FILES+= cmdsubst13.0 ${PACKAGE}FILES+= cmdsubst14.0 ${PACKAGE}FILES+= cmdsubst15.0 ${PACKAGE}FILES+= cmdsubst16.0 ${PACKAGE}FILES+= cmdsubst17.0 ${PACKAGE}FILES+= cmdsubst18.0 ${PACKAGE}FILES+= cmdsubst19.0 ${PACKAGE}FILES+= cmdsubst20.0 ${PACKAGE}FILES+= cmdsubst21.0 ${PACKAGE}FILES+= cmdsubst22.0 ${PACKAGE}FILES+= cmdsubst23.0 ${PACKAGE}FILES+= cmdsubst24.0 ${PACKAGE}FILES+= cmdsubst25.0 ${PACKAGE}FILES+= cmdsubst26.0 ${PACKAGE}FILES+= export1.0 ${PACKAGE}FILES+= export2.0 ${PACKAGE}FILES+= export3.0 ${PACKAGE}FILES+= heredoc1.0 ${PACKAGE}FILES+= heredoc2.0 ${PACKAGE}FILES+= ifs1.0 ${PACKAGE}FILES+= ifs2.0 ${PACKAGE}FILES+= ifs3.0 ${PACKAGE}FILES+= ifs4.0 ${PACKAGE}FILES+= ifs5.0 ${PACKAGE}FILES+= ifs6.0 ${PACKAGE}FILES+= ifs7.0 ${PACKAGE}FILES+= length1.0 ${PACKAGE}FILES+= length2.0 ${PACKAGE}FILES+= length3.0 ${PACKAGE}FILES+= length4.0 ${PACKAGE}FILES+= length5.0 ${PACKAGE}FILES+= length6.0 ${PACKAGE}FILES+= length7.0 ${PACKAGE}FILES+= length8.0 ${PACKAGE}FILES+= local1.0 ${PACKAGE}FILES+= local2.0 ${PACKAGE}FILES+= pathname1.0 ${PACKAGE}FILES+= pathname2.0 ${PACKAGE}FILES+= pathname3.0 ${PACKAGE}FILES+= pathname4.0 ${PACKAGE}FILES+= pathname5.0 ${PACKAGE}FILES+= pathname6.0 ${PACKAGE}FILES+= plus-minus1.0 ${PACKAGE}FILES+= plus-minus2.0 ${PACKAGE}FILES+= plus-minus3.0 ${PACKAGE}FILES+= plus-minus4.0 ${PACKAGE}FILES+= plus-minus5.0 ${PACKAGE}FILES+= plus-minus6.0 ${PACKAGE}FILES+= plus-minus7.0 ${PACKAGE}FILES+= plus-minus8.0 ${PACKAGE}FILES+= plus-minus9.0 ${PACKAGE}FILES+= question1.0 ${PACKAGE}FILES+= question2.0 ${PACKAGE}FILES+= readonly1.0 ${PACKAGE}FILES+= redir1.0 ${PACKAGE}FILES+= set-u1.0 ${PACKAGE}FILES+= set-u2.0 ${PACKAGE}FILES+= set-u3.0 ${PACKAGE}FILES+= tilde1.0 ${PACKAGE}FILES+= tilde2.0 ${PACKAGE}FILES+= trim1.0 ${PACKAGE}FILES+= trim2.0 ${PACKAGE}FILES+= trim3.0 ${PACKAGE}FILES+= trim4.0 ${PACKAGE}FILES+= trim5.0 ${PACKAGE}FILES+= trim6.0 ${PACKAGE}FILES+= trim7.0 ${PACKAGE}FILES+= trim8.0 ${PACKAGE}FILES+= trim9.0 ${PACKAGE}FILES+= trim10.0 ${PACKAGE}FILES+= trim11.0 .include Index: head/bin/sh/tests/expansion/arith15.0 =================================================================== --- head/bin/sh/tests/expansion/arith15.0 (nonexistent) +++ head/bin/sh/tests/expansion/arith15.0 (revision 342880) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +failures=0 + +check() { + if [ $(($1)) != $2 ]; then + failures=$((failures+1)) + echo "For $1, expected $2 actual $(($1))" + fi +} + +XXX=-9223372036854775808 +check "XXX" -9223372036854775808 +check "XXX - 1" 9223372036854775807 +check $(($XXX - 1)) 9223372036854775807 +check $(($XXX - 2)) 9223372036854775806 +check $((0x8000000000000000 == 0x7fffffffffffffff)) \ + 0 + +exit $((failures != 0)) Property changes on: head/bin/sh/tests/expansion/arith15.0 ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property