tst.basic2.d revision 178476
191100Sdes/* 2115619Sdes * CDDL HEADER START 3228690Sdes * 491100Sdes * The contents of this file are subject to the terms of the 591100Sdes * Common Development and Distribution License (the "License"). 691100Sdes * You may not use this file except in compliance with the License. 799158Sdes * 899158Sdes * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 999158Sdes * or http://www.opensolaris.org/os/licensing. 1091100Sdes * See the License for the specific language governing permissions 1191100Sdes * and limitations under the License. 1291100Sdes * 1391100Sdes * When distributing Covered Code, include this CDDL HEADER in each 1491100Sdes * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1591100Sdes * If applicable, add the following below this CDDL HEADER, with the 1691100Sdes * fields enclosed by brackets "[]" replaced with your own identifying 1791100Sdes * information: Portions Copyright [yyyy] [name of copyright owner] 1891100Sdes * 1991100Sdes * CDDL HEADER END 2091100Sdes */ 2191100Sdes 2291100Sdes/* 2391100Sdes * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2491100Sdes * Use is subject to license terms. 2591100Sdes */ 2691100Sdes 2791100Sdes#pragma ident "%Z%%M% %I% %E% SMI" 2891100Sdes 2991100Sdes/* 3091100Sdes * ASSERTION: Pointers can be stored in associative arrays. 3191100Sdes * 3291100Sdes * SECTION: Pointers and Arrays/Pointers and Addresses 3391100Sdes * 3491100Sdes * NOTES: 35228690Sdes * 3691100Sdes */ 3791100Sdes 38228690Sdes#pragma D option quiet 39228690Sdes 40228690SdesBEGIN 41228690Sdes{ 4291100Sdes assoc_array["kmemAddress"] = &`kmem_flags; 4391100Sdes kmemValue = *(assoc_array["kmemAddress"]); 4491100Sdes printf("Address of kmem_flags: %x\n", (int) assoc_array["kmemAddress"]); 4591100Sdes printf("Value of kmem_flags: %d\n", kmemValue); 4691100Sdes exit(0); 4791100Sdes} 4891100Sdes