9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Common Development and Distribution License (the "License").
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * or http://www.opensolaris.org/os/licensing.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * If applicable, add the following below this CDDL HEADER, with the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * fields enclosed by brackets "[]" replaced with your own identifying
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * information: Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Use is subject to license terms.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma ident "%Z%%M% %I% %E% SMI"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * ASSERTION:
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Translate an input expression to a pointer to a struct
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * SECTION: Translators/ Translator Declarations
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * SECTION: Translators/ Translate Operator
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma D option quiet
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlstruct myinput_struct {
9512fe850e98fdd448c638ca63fdd92a8a510255ahl int i;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char c;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl};
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlstruct myoutput_struct {
9512fe850e98fdd448c638ca63fdd92a8a510255ahl int myi;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl char myc;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl};
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahltranslator struct myoutput_struct < struct myinput_struct ivar >
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl myi = ((struct myinput_struct ) ivar).i;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl myc = ((struct myinput_struct ) ivar).c;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl};
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlstruct myinput_struct f;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlBEGIN
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl f.i = 1203;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl f.c = 'v';
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl realmyi = xlate < struct myoutput_struct *> (f)->myi;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl realmyc = xlate < struct myoutput_struct *> (f)->myc;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlBEGIN
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/(1203 != realmyi) || ('v' != realmyc)/
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("Failure");
9512fe850e98fdd448c638ca63fdd92a8a510255ahl exit(1);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlBEGIN
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/(1203 == realmyi) && ('v' == realmyc)/
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf("Success");
9512fe850e98fdd448c638ca63fdd92a8a510255ahl exit(0);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}