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#include <sys/cdefs.h> 28 29typedef void f(char *); 30 31static void 32f_a(char *a __unused) 33{ 34} 35 36static void 37f_b(char *a __unused) 38{ 39} 40 41static void 42f_c(char *a __unused) 43{ 44} 45 46static void 47f_d(char *a __unused) 48{ 49} 50 51static void 52f_e(char *a __unused) 53{ 54} 55 56static void 57fN(f func, char *a, int i __unused) 58{ 59 func(a); 60} 61 62static void 63fN2(f func, char *a, int i __unused) 64{ 65 func(a); 66} 67 68int 69main(void) 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} 94