xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d (revision 20a7641f9918de8574b8b3b47dbe35c4bfc78df1)
1 /*
2  * CDDL HEADER START
3  *
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.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma D option quiet
28 
29 BEGIN
30 {
31 	@["j-church"] = lquantize(1, 0, 10, 1, 100);
32 	@["j-church"] = lquantize(1, 0, 10, 1, -99);
33 	@["j-church"] = lquantize(1, 0, 10, 1, -1);
34 	val = 123;
35 }
36 
37 BEGIN
38 {
39 	@["k-ingleside"] = lquantize(1, 0, 10, 1, -val);
40 }
41 
42 BEGIN
43 {
44 	@["l-taraval"] = lquantize(0, 0, 10, 1, -val);
45 	@["l-taraval"] = lquantize(-1, 0, 10, 1, -val);
46 	@["l-taraval"] = lquantize(1, 0, 10, 1, val);
47 	@["l-taraval"] = lquantize(1, 0, 10, 1, val);
48 }
49 
50 BEGIN
51 {
52 	@["m-oceanview"] = lquantize(1, 0, 10, 1, (1 << 63) - 1);
53 	@["m-oceanview"] = lquantize(1, 0, 10, 1);
54 	@["m-oceanview"] = lquantize(2, 0, 10, 1, (1 << 63) - 1);
55 	@["m-oceanview"] = lquantize(8, 0, 10, 1, 400000);
56 }
57 
58 BEGIN
59 {
60 	@["n-judah"] = lquantize(1, 0, 10, 1, val);
61 	@["n-judah"] = lquantize(2, 0, 10, 1, val);
62 	@["n-judah"] = lquantize(2, 0, 10, 1, val);
63 	@["n-judah"] = lquantize(2, 0, 10, 1);
64 }
65 
66 BEGIN
67 {
68 	this->i = 1;
69 	this->val = (1 << 63) - 1;
70 
71 	@["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
72 	this->i++;
73 	this->val = ((1 << 63) - 1) / this->i;
74 
75 	@["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
76 	this->i++;
77 	this->val = ((1 << 63) - 1) / this->i;
78 
79 	@["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
80 	this->i++;
81 	this->val = ((1 << 63) - 1) / this->i;
82 
83 	@["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
84 	this->i++;
85 	this->val = ((1 << 63) - 1) / this->i;
86 
87 	@["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
88 	this->i++;
89 	this->val = ((1 << 63) - 1) / this->i;
90 
91 	@["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
92 	this->i++;
93 	this->val = ((1 << 63) - 1) / this->i;
94 
95 	@["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
96 	this->i++;
97 	this->val = ((1 << 63) - 1) / this->i;
98 }
99 
100 BEGIN
101 {
102 	this->i = 1;
103 
104 	/*
105 	 * We want to test the ability to sort very large quantizations
106 	 * that differ by a small amount.  Ideally, they would differ only
107 	 * by 1 -- but that is smaller than the precision of long doubles of
108 	 * this magnitude on x86.  To assure that the same test works on x86
109 	 * just as it does on SPARC, we pick a value that is just larger than
110 	 * the precision at this magnitude.  It should go without saying that
111 	 * this robustness on new ISAs very much depends on the precision
112 	 * of the long double representation.
113 	 */
114 	this->val = (1 << 63) - 7;
115 
116 	@["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
117 	this->i++;
118 	this->val = ((1 << 63) - 1) / this->i;
119 
120 	@["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
121 	this->i++;
122 	this->val = ((1 << 63) - 1) / this->i;
123 
124 	@["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
125 	this->i++;
126 	this->val = ((1 << 63) - 1) / this->i;
127 
128 	@["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
129 	this->i++;
130 	this->val = ((1 << 63) - 1) / this->i;
131 
132 	@["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
133 	this->i++;
134 	this->val = ((1 << 63) - 1) / this->i;
135 
136 	@["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
137 	this->i++;
138 	this->val = ((1 << 63) - 1) / this->i;
139 
140 	@["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
141 	this->i++;
142 	this->val = ((1 << 63) - 1) / this->i;
143 }
144 
145 BEGIN
146 {
147 	exit(0);
148 }
149