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