From a3a7b74e18a19c7946f9ac716666366ca00fbacc Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Mon, 21 Aug 2017 21:58:42 +0000 Subject: [PATCH] Add a regression test for r322773. MFC after: 1 week --- .../err.D_LLQUANT_MAGTOOBIG.offbyone.d | 35 +++++++++++++++++++ .../dtrace/tests/common/llquantize/Makefile | 1 + 2 files changed, 36 insertions(+) create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d new file mode 100644 index 000000000000..9e6eb3e941bf --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d @@ -0,0 +1,35 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2017 Mark Johnston + */ + +/* + * A regression test for FreeBSD r322773. 100^9 fits in 64 bits, but + * llquantize() will create buckets up to 100^{10}, which does not fit. + */ + +BEGIN +{ + @ = llquantize(0, 100, 0, 9, 100); + exit(0); +} diff --git a/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile b/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile index be71bec5159e..ed99dd1e116f 100644 --- a/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile @@ -22,6 +22,7 @@ ${PACKAGE}FILES= \ err.D_LLQUANT_LOWVAL.d \ err.D_LLQUANT_MAGRANGE.d \ err.D_LLQUANT_MAGTOOBIG.d \ + err.D_LLQUANT_MAGTOOBIG.offbyone.d \ err.D_LLQUANT_NSTEPMATCH.d \ err.D_LLQUANT_NSTEPTYPE.d \ err.D_LLQUANT_NSTEPVAL.d \