1218885Sdim/*
2218885Sdim * CDDL HEADER START
3218885Sdim *
4218885Sdim * The contents of this file are subject to the terms of the
5218885Sdim * Common Development and Distribution License (the "License").
6218885Sdim * You may not use this file except in compliance with the License.
7218885Sdim *
8218885Sdim * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9218885Sdim * or http://www.opensolaris.org/os/licensing.
10218885Sdim * See the License for the specific language governing permissions
11218885Sdim * and limitations under the License.
12218885Sdim *
13218885Sdim * When distributing Covered Code, include this CDDL HEADER in each
14218885Sdim * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15218885Sdim * If applicable, add the following below this CDDL HEADER, with the
16218885Sdim * fields enclosed by brackets "[]" replaced with your own identifying
17218885Sdim * information: Portions Copyright [yyyy] [name of copyright owner]
18218885Sdim *
19218885Sdim * CDDL HEADER END
20218885Sdim */
21218885Sdim
22218885Sdim/*
23218885Sdim * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24218885Sdim * Use is subject to license terms.
25218885Sdim */
26218885Sdim
27218885Sdim#pragma ident	"%Z%%M%	%I%	%E% SMI"
28218885Sdim
29218885Sdim/*
30218885Sdim * ASSERTION: sizeof returns the size in bytes of any D expression or data
31221345Sdim * type. For an associative array, the D compiler should throw an error since
32221345Sdim * an associative array does not have a fixed size.
33221345Sdim *
34221345Sdim * SECTION: Structs and Unions/Member Sizes and Offsets
35221345Sdim *
36221345Sdim */
37221345Sdim#pragma D option quiet
38218885Sdim
39221345SdimBEGIN
40221345Sdim{
41223017Sdim	assoc_array[0] = 010;
42223017Sdim	assoc_array[1] = 100;
43221345Sdim	assoc_array[2] = 210;
44221345Sdim
45221345Sdim	printf("sizeof (assoc_array): %d\n", sizeof (assoc_array));
46221345Sdim	printf("sizeof (assoc_array[0]): %d\n", sizeof (assoc_array[0]));
47218885Sdim	printf("sizeof (assoc_array[1]): %d\n", sizeof (assoc_array[1]));
48218885Sdim	printf("sizeof (assoc_array[2]): %d\n", sizeof (assoc_array[2]));
49218885Sdim
50218885Sdim	exit(0);
51218885Sdim}
52218885Sdim