1*2804Stomee /* 2*2804Stomee * CDDL HEADER START 3*2804Stomee * 4*2804Stomee * The contents of this file are subject to the terms of the 5*2804Stomee * Common Development and Distribution License (the "License"). 6*2804Stomee * You may not use this file except in compliance with the License. 7*2804Stomee * 8*2804Stomee * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*2804Stomee * or http://www.opensolaris.org/os/licensing. 10*2804Stomee * See the License for the specific language governing permissions 11*2804Stomee * and limitations under the License. 12*2804Stomee * 13*2804Stomee * When distributing Covered Code, include this CDDL HEADER in each 14*2804Stomee * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*2804Stomee * If applicable, add the following below this CDDL HEADER, with the 16*2804Stomee * fields enclosed by brackets "[]" replaced with your own identifying 17*2804Stomee * information: Portions Copyright [yyyy] [name of copyright owner] 18*2804Stomee * 19*2804Stomee * CDDL HEADER END 20*2804Stomee */ 21*2804Stomee 22*2804Stomee /* 23*2804Stomee * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24*2804Stomee * Use is subject to license terms. 25*2804Stomee */ 26*2804Stomee 27*2804Stomee #pragma ident "%Z%%M% %I% %E% SMI" 28*2804Stomee 29*2804Stomee 30*2804Stomee /* 31*2804Stomee * ASSERTION: 32*2804Stomee * Signed integer keys print and sort as expected. 33*2804Stomee * 34*2804Stomee * SECTION: Aggregations, Printing Aggregations 35*2804Stomee * 36*2804Stomee * NOTES: DTrace sorts integer keys as unsigned values, yet prints 32- 37*2804Stomee * and 64-bit integers as signed values. Since the Java DTrace API is 38*2804Stomee * expected to emulate this behavior, this test was added to ensure that 39*2804Stomee * the behavior is preserved. Consistency with trace() output is also 40*2804Stomee * tested. 41*2804Stomee */ 42*2804Stomee 43*2804Stomee #pragma D option quiet 44*2804Stomee #pragma D option aggsortkey 45*2804Stomee 46*2804Stomee BEGIN 47*2804Stomee { 48*2804Stomee trace((char)-2); 49*2804Stomee trace("\n"); 50*2804Stomee trace((char)-1); 51*2804Stomee trace("\n"); 52*2804Stomee trace((char)0); 53*2804Stomee trace("\n"); 54*2804Stomee trace((char)1); 55*2804Stomee trace("\n"); 56*2804Stomee trace((char)2); 57*2804Stomee trace("\n"); 58*2804Stomee trace("\n"); 59*2804Stomee 60*2804Stomee trace((short)-2); 61*2804Stomee trace("\n"); 62*2804Stomee trace((short)-1); 63*2804Stomee trace("\n"); 64*2804Stomee trace((short)0); 65*2804Stomee trace("\n"); 66*2804Stomee trace((short)1); 67*2804Stomee trace("\n"); 68*2804Stomee trace((short)2); 69*2804Stomee trace("\n"); 70*2804Stomee trace("\n"); 71*2804Stomee 72*2804Stomee trace(-2); 73*2804Stomee trace("\n"); 74*2804Stomee trace(-1); 75*2804Stomee trace("\n"); 76*2804Stomee trace(0); 77*2804Stomee trace("\n"); 78*2804Stomee trace(1); 79*2804Stomee trace("\n"); 80*2804Stomee trace(2); 81*2804Stomee trace("\n"); 82*2804Stomee trace("\n"); 83*2804Stomee 84*2804Stomee trace((long long)-2); 85*2804Stomee trace("\n"); 86*2804Stomee trace((long long)-1); 87*2804Stomee trace("\n"); 88*2804Stomee trace((long long)0); 89*2804Stomee trace("\n"); 90*2804Stomee trace((long long)1); 91*2804Stomee trace("\n"); 92*2804Stomee trace((long long)2); 93*2804Stomee trace("\n"); 94*2804Stomee 95*2804Stomee @i8[(char)-2] = sum(-2); 96*2804Stomee @i8[(char)-1] = sum(-1); 97*2804Stomee @i8[(char)0] = sum(0); 98*2804Stomee @i8[(char)1] = sum(1); 99*2804Stomee @i8[(char)2] = sum(2); 100*2804Stomee 101*2804Stomee @i16[(short)-2] = sum(-2); 102*2804Stomee @i16[(short)-1] = sum(-1); 103*2804Stomee @i16[(short)0] = sum(0); 104*2804Stomee @i16[(short)1] = sum(1); 105*2804Stomee @i16[(short)2] = sum(2); 106*2804Stomee 107*2804Stomee @i32[-2] = sum(-2); 108*2804Stomee @i32[-1] = sum(-1); 109*2804Stomee @i32[0] = sum(0); 110*2804Stomee @i32[1] = sum(1); 111*2804Stomee @i32[2] = sum(2); 112*2804Stomee 113*2804Stomee @i64[(long long)-2] = sum(-2); 114*2804Stomee @i64[(long long)-1] = sum(-1); 115*2804Stomee @i64[(long long)0] = sum(0); 116*2804Stomee @i64[(long long)1] = sum(1); 117*2804Stomee @i64[(long long)2] = sum(2); 118*2804Stomee 119*2804Stomee exit(0); 120*2804Stomee } 121