1238582Smm/* 2238582Smm * CDDL HEADER START 3238582Smm * 4238582Smm * The contents of this file are subject to the terms of the 5238582Smm * Common Development and Distribution License (the "License"). 6238582Smm * You may not use this file except in compliance with the License. 7238582Smm * 8238582Smm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9238582Smm * or http://www.opensolaris.org/os/licensing. 10238582Smm * See the License for the specific language governing permissions 11238582Smm * and limitations under the License. 12238582Smm * 13238582Smm * When distributing Covered Code, include this CDDL HEADER in each 14238582Smm * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15238582Smm * If applicable, add the following below this CDDL HEADER, with the 16238582Smm * fields enclosed by brackets "[]" replaced with your own identifying 17238582Smm * information: Portions Copyright [yyyy] [name of copyright owner] 18238582Smm * 19238582Smm * CDDL HEADER END 20238582Smm */ 21238582Smm 22238582Smm/* 23238582Smm * Copyright (c) 2011 by Delphix. All rights reserved. 24238582Smm */ 25238582Smm 26238582Smm#pragma D option quiet 27238582Smm 28238582Smmtypedef struct bar { 29238582Smm int alpha; 30238582Smm} bar_t; 31238582Smm 32238582Smmtypedef struct foo { 33238582Smm int a[3]; 34238582Smm char b[30]; 35238582Smm bar_t c[2]; 36238582Smm char d[3]; 37238582Smm} foo_t; 38238582Smm 39238582SmmBEGIN 40238582Smm{ 41238582Smm this->f = (foo_t *)alloca(sizeof (foo_t)); 42238582Smm 43238582Smm this->f->a[0] = 1; 44238582Smm this->f->a[1] = 2; 45238582Smm this->f->a[2] = 3; 46238582Smm this->f->b[0] = 'a'; 47238582Smm this->f->b[1] = 'b'; 48238582Smm this->f->b[2] = 0; 49238582Smm this->f->c[0].alpha = 5; 50238582Smm this->f->c[1].alpha = 6; 51238582Smm this->f->c[2].alpha = 7; 52238582Smm this->f->d[0] = 4; 53238582Smm this->f->d[1] = 0; 54238582Smm this->f->d[2] = 0; 55238582Smm 56238582Smm print(this->f->a); 57238582Smm print(this->f->b); 58238582Smm print(this->f->c); 59238582Smm print(*this->f); 60238582Smm 61238582Smm exit(0); 62238582Smm} 63