4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #
pragma ident
"%Z%%M% %I% %E% SMI"
31 * Test circular declaration of translations
33 * SECTION: Translators/ Translator Declarations
34 * SECTION: Translators/ Translate Operator
37 #
pragma D option quiet
44 struct output_struct
{
49 translator
struct output_struct
< struct input_struct ivar
>
51 myi
= ((struct input_struct
) ivar
).i
;
52 myc
= ((struct input_struct
) ivar
).c
;
55 translator
struct input_struct
< struct output_struct uvar
>
57 i
= ((struct output_struct
) uvar
).myi
;
58 c
= ((struct output_struct
) uvar
).myc
;
61 struct input_struct f1
;
62 struct output_struct f2
;
72 printf("Testing circular translations\n");
73 forwardi
= xlate
< struct output_struct
> (f1
).myi
;
74 forwardc
= xlate
< struct output_struct
> (f1
).myc
;
75 backwardi
= xlate
< struct input_struct
> (f2
).i
;
76 backwardc
= xlate
< struct input_struct
> (f2
).c
;
78 printf("forwardi: %d\tforwardc: %c\n", forwardi
, forwardc
);
79 printf("backwardi: %d\tbackwardc: %c", backwardi
, backwardc
);
84 /(10 == forwardi
) && ('c' == forwardc
) && (100 == backwardi
) &&
91 /(10 != forwardi
) ||
('c' != forwardc
) ||
(100 != backwardi
) ||