1 /*
2  * CDDL HEADER START
3  *
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
7  * 1.0 of the CDDL.
8  *
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.
12  *
13  * CDDL HEADER END
14  */
15 
16 /*
17  * Copyright (c) 2012 by Delphix. All rights reserved.
18  */
19 
20 /*
21  * Test compile-time casting between integer types of different size.
22  */
23 
24 #pragma D option quiet
25 
26 int64_t x;
27 
28 BEGIN
29 {
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);
38 	printf("\n");
39 
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);
48 
49 	exit(0);
50 }
51