4 * This file and its contents are supplied under the terms of the
5 * Common Development and Distribution License ("CDDL"), version 1.0.
6 * You may only use this file in accordance with the terms of version
9 * A full copy of the text of the CDDL should have accompanied this
10 * source. A copy of the CDDL is also available via the Internet at
11 * http://www.illumos.org/license/CDDL.
17 * Copyright (c) 2012 by Delphix. All rights reserved.
21 * Test compile-time casting between integer types of different size.
24 #
pragma D option quiet
30 x
= (int32_t
)(int16_t
)0xfff0;
31 printf("%16x %20d %20u\n", x
, x
, x
);
32 x
= (int32_t
)(uint16_t
)0xfff0;
33 printf("%16x %20d %20u\n", x
, x
, x
);
34 x
= (uint32_t
)(int16_t
)0xfff0;
35 printf("%16x %20d %20u\n", x
, x
, x
);
36 x
= (uint32_t
)(uint16_t
)0xfff0;
37 printf("%16x %20d %20u\n", x
, x
, x
);
40 x
= (int16_t
)(int32_t
)0xfff0;
41 printf("%16x %20d %20u\n", x
, x
, x
);
42 x
= (int16_t
)(uint32_t
)0xfff0;
43 printf("%16x %20d %20u\n", x
, x
, x
);
44 x
= (uint16_t
)(int32_t
)0xfff0;
45 printf("%16x %20d %20u\n", x
, x
, x
);
46 x
= (uint16_t
)(uint32_t
)0xfff0;
47 printf("%16x %20d %20u\n", x
, x
, x
);