8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / dtrace / test / tst / common / arithmetic / tst.compcast.d
blob714fbe373b2c7310aa7b699bfe6bc80826d87e00
1 /*
2 * CDDL HEADER START
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.
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.
13 * CDDL HEADER END
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
26 int64_t x;
28 BEGIN
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");
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);
49 exit(0);