1178476Sjb/*
2178476Sjb * CDDL HEADER START
3178476Sjb *
4178476Sjb * The contents of this file are subject to the terms of the
5178476Sjb * Common Development and Distribution License (the "License").
6178476Sjb * You may not use this file except in compliance with the License.
7178476Sjb *
8178476Sjb * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9178476Sjb * or http://www.opensolaris.org/os/licensing.
10178476Sjb * See the License for the specific language governing permissions
11178476Sjb * and limitations under the License.
12178476Sjb *
13178476Sjb * When distributing Covered Code, include this CDDL HEADER in each
14178476Sjb * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15178476Sjb * If applicable, add the following below this CDDL HEADER, with the
16178476Sjb * fields enclosed by brackets "[]" replaced with your own identifying
17178476Sjb * information: Portions Copyright [yyyy] [name of copyright owner]
18178476Sjb *
19178476Sjb * CDDL HEADER END
20178476Sjb */
21178476Sjb
22178476Sjb/*
23178476Sjb * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24178476Sjb * Use is subject to license terms.
25178476Sjb */
26178476Sjb
27178476Sjb#pragma ident	"%Z%%M%	%I%	%E% SMI"
28178476Sjb
29178476Sjb/*
30178476Sjb * ASSERTION:
31178476Sjb * When struct definitions are nested inside one another, the inner struct
32178476Sjb * should be defined before the outer one can declare it as a variable.
33178476Sjb *
34178476Sjb * SECTION: Structs and Unions/Structs
35178476Sjb *
36178476Sjb */
37178476Sjb
38178476Sjb#pragma D option quiet
39178476Sjb
40178476Sjbstruct InnerMore {
41178476Sjb	struct InnerMost IMost;
42178476Sjb	int dummy_More;
43178476Sjb};
44178476Sjb
45178476Sjbstruct InnerMost {
46178476Sjb	int position;
47178476Sjb	char content;
48178476Sjb};
49178476Sjb
50178476Sjbstruct Inner {
51178476Sjb	struct InnerMore IMore;
52178476Sjb	int dummy_More;
53178476Sjb};
54178476Sjb
55178476Sjbstruct Outer {
56178476Sjb	struct Inner I;
57178476Sjb	int dummy_More;
58178476Sjb};
59178476Sjb
60178476Sjbstruct OuterMore {
61178476Sjb	struct Outer O;
62178476Sjb	int dummy_More;
63178476Sjb};
64178476Sjb
65178476Sjbstruct OuterMost {
66178476Sjb	struct OuterMore OMore;
67178476Sjb	int dummy_More;
68178476Sjb} OMost;
69178476Sjb
70178476Sjb
71178476SjbBEGIN
72178476Sjb{
73178476Sjb
74178476Sjb	OMost.dummy_More = 0;
75178476Sjb	OMost.OMore.dummy_More = 1;
76178476Sjb	OMost.OMore.O.dummy_More = 2;
77178476Sjb	OMost.OMore.O.I.dummy_More = 3;
78178476Sjb	OMost.OMore.O.I.IMore.dummy_More = 4;
79178476Sjb	OMost.OMore.O.I.IMore.IMost.position = 5;
80178476Sjb	OMost.OMore.O.I.IMore.IMost.content = 'e';
81178476Sjb
82178476Sjb	printf("OMost.dummy_More: %d\nOMost.OMore.dummy_More: %d\n",
83178476Sjb	OMost.dummy_More, OMost.OMore.dummy_More);
84178476Sjb
85178476Sjb	printf("OMost.OMore.O.dummy_More: %d\nOMost.OMore.O.I.dummy_More: %d\n",
86178476Sjb	OMost.OMore.O.dummy_More, OMost.OMore.O.I.dummy_More);
87178476Sjb
88178476Sjb	printf("OMost.OMore.O.I.IMore.dummy_More:%d\n",
89178476Sjb	OMost.OMore.O.I.IMore.dummy_More);
90178476Sjb
91178476Sjb	printf("OMost.OMore.O.I.IMore.IMost.position: %d\n",
92178476Sjb	OMost.OMore.O.I.IMore.IMost.position);
93178476Sjb
94178476Sjb	printf("OMost.OMore.O.I.IMore.IMost.content: %c\n",
95178476Sjb	OMost.OMore.O.I.IMore.IMost.content);
96178476Sjb
97178476Sjb	exit(0);
98178476Sjb}
99178476Sjb
100178476SjbEND
101178476Sjb/(0 != OMost.dummy_More) || (1 != OMost.OMore.dummy_More)
102178476Sjb    (2 != OMost.OMore.O.dummy_More) || (3 != OMost.OMore.O.I.dummy_More)
103178476Sjb    (4 != OMost.OMore.O.I.IMore.dummy_More)
104178476Sjb    (5 != OMost.OMore.O.I.IMore.IMost.position)
105178476Sjb    ('e' != OMost.OMore.O.I.IMore.IMost.content)/
106178476Sjb{
107178476Sjb	exit(1);
108178476Sjb}
109