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]
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 * ASSERTION: sizeof returns the size in bytes of any D expression or data
33 * SECTION: Structs and Unions/Member Sizes and Offsets
35 #pragma D option quiet
41 long long new_long_long;
51 uintptr_t new_uintptr;
56 long double new_long_double;
92 printf("sizeof (new_char): %d\n", sizeof (new_char));
93 printf("sizeof (new_short): %d\n", sizeof (new_short));
94 printf("sizeof (new_int): %d\n", sizeof (new_int));
95 printf("sizeof (new_long): %d\n", sizeof (new_long));
96 printf("sizeof (new_long_long): %d\n", sizeof (new_long_long));
97 printf("sizeof (new_int8): %d\n", sizeof (new_int8));
98 printf("sizeof (new_int16): %d\n", sizeof (new_int16));
99 printf("sizeof (new_int32): %d\n", sizeof (new_int32));
100 printf("sizeof (new_int64): %d\n", sizeof (new_int64));
101 printf("sizeof (pointer): %d\n", sizeof (pointer));
102 printf("sizeof (intptr_t): %d\n", sizeof (intptr_t));
103 printf("sizeof (new_struct): %d\n", sizeof (new_struct));
104 printf("sizeof (anon_struct): %d\n", sizeof (anon_struct));
105 printf("sizeof (new_union): %d\n", sizeof (new_union));
106 printf("sizeof (anon_union): %d\n", sizeof (anon_union));
107 printf("sizeof (new_enum): %d\n", sizeof (new_enum));
112 /(1 != sizeof (new_char)) || (2 != sizeof (new_short)) ||
113 (4 != sizeof (new_int)) ||
114 ((4 != sizeof (new_long)) && (8 != sizeof (new_long))) ||
115 (8 != sizeof (new_long_long)) ||
116 (1 != sizeof (new_int8)) || (2 != sizeof (new_int16)) ||
117 (4 != sizeof (new_int32)) || (8 != sizeof (new_int64)) ||
118 (sizeof (pointer) != sizeof (new_intptr)) || (8 != sizeof (new_struct)) ||
119 (4 != sizeof (new_union)) || (4 != sizeof (new_enum))/