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 typedef void f(char *);
28
29 static void
f_a(char * a)30 f_a(char *a)
31 {
32 }
33
34 static void
f_b(char * a)35 f_b(char *a)
36 {
37 }
38
39 static void
f_c(char * a)40 f_c(char *a)
41 {
42 }
43
44 static void
f_d(char * a)45 f_d(char *a)
46 {
47 }
48
49 static void
f_e(char * a)50 f_e(char *a)
51 {
52 }
53
54 static void
fN(f func,char * a,int i)55 fN(f func, char *a, int i)
56 {
57 func(a);
58 }
59
60 static void
fN2(f func,char * a,int i)61 fN2(f func, char *a, int i)
62 {
63 func(a);
64 }
65
66 int
main()67 main()
68 {
69 /*
70 * Avoid length of 1, 2, 4, or 8 bytes so DTrace will treat the data as
71 * a byte array.
72 */
73 char a[] = {(char)-7, (char)201, (char)0, (char)0, (char)28, (char)1};
74 char b[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)0};
75 char c[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)1};
76 char d[] = {(char)-7, (char)201, (char)0, (char)0, (char)29, (char)0};
77 char e[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)0};
78
79 fN(f_a, a, 1);
80 fN(f_b, b, 0);
81 fN(f_d, d, 102);
82 fN2(f_e, e, -2);
83 fN(f_c, c, 0);
84 fN(f_a, a, -1);
85 fN(f_d, d, 101);
86 fN(f_e, e, -2);
87 fN(f_e, e, 2);
88 fN2(f_e, e, 2);
89
90 return (0);
91 }
92