tst.EnumValAssign.d revision 178477
150476Speter/*
215903Swosch * CDDL HEADER START
315903Swosch *
415903Swosch * The contents of this file are subject to the terms of the
515903Swosch * Common Development and Distribution License (the "License").
615903Swosch * You may not use this file except in compliance with the License.
715903Swosch *
815903Swosch * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
915903Swosch * or http://www.opensolaris.org/os/licensing.
1015903Swosch * See the License for the specific language governing permissions
1115903Swosch * and limitations under the License.
1215903Swosch *
1315903Swosch * When distributing Covered Code, include this CDDL HEADER in each
14139761Skrion * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1534678Sbde * If applicable, add the following below this CDDL HEADER, with the
1623546Swosch * fields enclosed by brackets "[]" replaced with your own identifying
1723546Swosch * information: Portions Copyright [yyyy] [name of copyright owner]
1823546Swosch *
1939161Sobrien * CDDL HEADER END
2015903Swosch */
2139161Sobrien
2215903Swosch/*
2315903Swosch * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2415903Swosch * Use is subject to license terms.
2515903Swosch */
2615903Swosch
2715903Swosch/*
2815903Swosch * ASSERTION:
2932216Swosch * Test the D enumerations with and without initilialization of the identifiers.
3032216Swosch * Also test for values with negative integer assignments, expressions and
3132216Swosch * fractions.
3232216Swosch *
33218525Skeramida * SECTION: Type and Constant Definitions/Enumerations
34218525Skeramida *
3515903Swosch */
3615903Swosch
3715903Swosch#pragma ident	"%Z%%M%	%I%	%E% SMI"
3815903Swosch
39119057Sobrien#pragma D option quiet
4015903Swosch
4115903Swoschenum colors {
4215903Swosch	RED,
4315903Swosch	ORANGE = 5 + 5,
4415903Swosch	YELLOW = 2,
4515903Swosch	GREEN,
4615903Swosch	BLUE = GREEN + ORANGE,
4765501Sobrien 	PINK = 5/4,
4815903Swosch	INDIGO = -2,
49186894Sbz	VIOLET
5015903Swosch};
51186894Sbz
5215903Swoschprofile:::tick-1sec
5353033Sphantom/(0 == RED) && (10 == ORANGE) && (2 == YELLOW) && (3 == GREEN) &&
5415903Swosch    (13 == BLUE) && (1 == PINK) && (-2 == INDIGO) && (-1 == VIOLET)/
5515903Swosch{
5615903Swosch	exit(0);
5715903Swosch}
5815903Swosch