]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / cddl / contrib / opensolaris / cmd / dtrace / test / tst / common / java_api / tst.ProbeData.c
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 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26
27 #pragma ident   "%Z%%M% %I%     %E% SMI"
28
29 typedef void f(char *);
30
31 static void
32 f_a(char *a)
33 {
34 }
35
36 static void
37 f_b(char *a)
38 {
39 }
40
41 static void
42 f_c(char *a)
43 {
44 }
45
46 static void
47 f_d(char *a)
48 {
49 }
50
51 static void
52 f_e(char *a)
53 {
54 }
55
56 static void
57 fN(f func, char *a, int i)
58 {
59         func(a);
60 }
61
62 static void
63 fN2(f func, char *a, int i)
64 {
65         func(a);
66 }
67
68 int
69 main()
70 {
71         /*
72          * Avoid length of 1, 2, 4, or 8 bytes so DTrace will treat the data as
73          * a byte array.
74          */
75         char a[] = {(char)-7, (char)201, (char)0, (char)0, (char)28, (char)1};
76         char b[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)0};
77         char c[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)1};
78         char d[] = {(char)-7, (char)201, (char)0, (char)0, (char)29, (char)0};
79         char e[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)0};
80
81         fN(f_a, a, 1);
82         fN(f_b, b, 0);
83         fN(f_d, d, 102);
84         fN2(f_e, e, -2);
85         fN(f_c, c, 0);
86         fN(f_a, a, -1);
87         fN(f_d, d, 101);
88         fN(f_e, e, -2);
89         fN(f_e, e, 2);
90         fN2(f_e, e, 2);
91
92         return (0);
93 }