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 * positive type conversion checks
33 * SECTION: Types, Operators, and Expressions/Type Conversions
35 * NOTES: not all type conversions are checked. A lot of this section
36 * is tested within other tests.
39 #pragma D option quiet
52 printf("c is %c i is %d\n", c, i);
58 printf("i is %d c is %c\n", i, c);
63 printf("c is %c s is %d\n", c, s);
69 printf("s is %d c is %c\n", s, c);
75 printf("i is %d s is %d\n", i, s);
81 printf("s is %d i is %d\n", s, i);
83 /* int -> long long */
87 printf("i is %d ll is %x\n", i, ll);
89 /* long long -> int */
93 printf("ll is %d i is %x\n", ll, i);
95 /* char -> long long */
99 printf("c is %c ll is %x\n", c, ll);
101 /* long long -> char */
105 printf("ll is %x c is %c\n", ll, c);