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 execution-time casting between integer types of different size.
24 #
pragma D option quiet
32 x
= (int32_t
)(int16_t
)z
;
33 printf("%16x %20d %20u\n", x
, x
, x
);
34 x
= (int32_t
)(uint16_t
)z
;
35 printf("%16x %20d %20u\n", x
, x
, x
);
36 x
= (uint32_t
)(int16_t
)z
;
37 printf("%16x %20d %20u\n", x
, x
, x
);
38 x
= (uint32_t
)(uint16_t
)z
;
39 printf("%16x %20d %20u\n", x
, x
, x
);
42 x
= (int16_t
)(int32_t
)z
;
43 printf("%16x %20d %20u\n", x
, x
, x
);
44 x
= (int16_t
)(uint32_t
)z
;
45 printf("%16x %20d %20u\n", x
, x
, x
);
46 x
= (uint16_t
)(int32_t
)z
;
47 printf("%16x %20d %20u\n", x
, x
, x
);
48 x
= (uint16_t
)(uint32_t
)z
;
49 printf("%16x %20d %20u\n", x
, x
, x
);