4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill/*
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * CDDL HEADER START
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill *
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * The contents of this file are subject to the terms of the
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * Common Development and Distribution License (the "License").
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * You may not use this file except in compliance with the License.
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill *
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * or http://www.opensolaris.org/os/licensing.
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * See the License for the specific language governing permissions
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * and limitations under the License.
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill *
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * When distributing Covered Code, include this CDDL HEADER in each
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * If applicable, add the following below this CDDL HEADER, with the
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * fields enclosed by brackets "[]" replaced with your own identifying
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * information: Portions Copyright [yyyy] [name of copyright owner]
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill *
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * CDDL HEADER END
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill */
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill/*
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill * Copyright (c) 2011, Joyent, Inc. All rights reserved.
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill */
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill#pragma D option quiet
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrillint64_t val[int];
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan CantrillBEGIN
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill{
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill base = -2;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill i = 0;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill val[i++] = -10;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill val[i++] = -1;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill val[i++] = 0;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill val[i++] = 10;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill val[i++] = 100;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill val[i++] = 1000;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill val[i++] = (1LL << 62);
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill maxval = i;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill i = 0;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill}
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrilltick-1ms
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill/i < maxval/
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill{
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill printf("base %2d of %20d: ", base, val[i]);
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill}
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrilltick-1ms
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill/i < maxval/
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill{
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill printf(" %s\n", lltostr(val[i], base));
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill}
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan CantrillERROR
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill{
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill printf(" <error>\n");
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill}
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrilltick-1ms
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill/i < maxval/
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill{
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill i++;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill}
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrilltick-1ms
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill/i == maxval/
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill{
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill i = 0;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill base++;
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill}
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrilltick-1ms
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill/base > 40/
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill{
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill exit(0);
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill}
4c943354ea4dfb1e1ff780a1fcd1e862b78b6e8cBryan Cantrill