tst.EnumValAssign.d revision 178476
1298770Sdelphij/*
2275970Scy * CDDL HEADER START
3275970Scy *
4275970Scy * The contents of this file are subject to the terms of the
5275970Scy * Common Development and Distribution License (the "License").
6298770Sdelphij * You may not use this file except in compliance with the License.
7275970Scy *
8275970Scy * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9275970Scy * or http://www.opensolaris.org/os/licensing.
10275970Scy * See the License for the specific language governing permissions
11275970Scy * and limitations under the License.
12275970Scy *
13275970Scy * When distributing Covered Code, include this CDDL HEADER in each
14275970Scy * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15275970Scy * If applicable, add the following below this CDDL HEADER, with the
16275970Scy * fields enclosed by brackets "[]" replaced with your own identifying
17275970Scy * information: Portions Copyright [yyyy] [name of copyright owner]
18275970Scy *
19275970Scy * CDDL HEADER END
20275970Scy */
21275970Scy
22275970Scy/*
23275970Scy * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24275970Scy * Use is subject to license terms.
25275970Scy */
26275970Scy
27275970Scy/*
28275970Scy * ASSERTION:
29275970Scy * Test the D enumerations with and without initilialization of the identifiers.
30275970Scy * Also test for values with negative integer assignments, expressions and
31275970Scy * fractions.
32275970Scy *
33275970Scy * SECTION: Type and Constant Definitions/Enumerations
34275970Scy *
35275970Scy */
36275970Scy
37275970Scy#pragma ident	"%Z%%M%	%I%	%E% SMI"
38275970Scy
39275970Scy#pragma D option quiet
40275970Scy
41275970Scyenum colors {
42275970Scy	RED,
43275970Scy	ORANGE = 5 + 5,
44275970Scy	YELLOW = 2,
45275970Scy	GREEN,
46275970Scy	BLUE = GREEN + ORANGE,
47275970Scy 	PINK = 5/4,
48275970Scy	INDIGO = -2,
49275970Scy	VIOLET
50275970Scy};
51275970Scy
52275970Scyprofile:::tick-1sec
53275970Scy/(0 == RED) && (10 == ORANGE) && (2 == YELLOW) && (3 == GREEN) &&
54275970Scy    (13 == BLUE) && (1 == PINK) && (-2 == INDIGO) && (-1 == VIOLET)/
55275970Scy{
56275970Scy	exit(0);
57275970Scy}
58275970Scy