diff options
Diffstat (limited to '')
-rw-r--r-- | src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d | 87 | ||||
-rw-r--r-- | src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d.out | 45 |
2 files changed, 132 insertions, 0 deletions
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d new file mode 100644 index 00000000..d15236ba --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d @@ -0,0 +1,87 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with simple integer arguments, using a variety of + * sizes and thereby exercise the automatic size extension feature. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("\n%d\n", (char)0x1234567890abcdef); + printf("%d\n", (short)0x1234567890abcdef); + printf("%d\n", (int)0x1234567890abcdef); + printf("%d\n", (long long)0x1234567890abcdef); + + printf("\n%d\n", (unsigned char)0x1234567890abcdef); + printf("%d\n", (unsigned short)0x1234567890abcdef); + printf("%d\n", (unsigned int)0x1234567890abcdef); + printf("%d\n", (unsigned long long)0x1234567890abcdef); + + printf("\n%u\n", (char)0x1234567890abcdef); + printf("%u\n", (short)0x1234567890abcdef); + printf("%u\n", (int)0x1234567890abcdef); + printf("%u\n", (long long)0x1234567890abcdef); + + printf("\n%u\n", (unsigned char)0x1234567890abcdef); + printf("%u\n", (unsigned short)0x1234567890abcdef); + printf("%u\n", (unsigned int)0x1234567890abcdef); + printf("%u\n", (unsigned long long)0x1234567890abcdef); + + printf("\n%x\n", (unsigned char)0x1234567890abcdef); + printf("%x\n", (unsigned short)0x1234567890abcdef); + printf("%x\n", (unsigned int)0x1234567890abcdef); + printf("%x\n", (unsigned long long)0x1234567890abcdef); + + printf("\n%x\n", (char)0x1234567890abcdef); + printf("%x\n", (short)0x1234567890abcdef); + printf("%x\n", (int)0x1234567890abcdef); + printf("%x\n", (long long)0x1234567890abcdef); + + printf("\n%o\n", (unsigned char)0x1234567890abcdef); + printf("%o\n", (unsigned short)0x1234567890abcdef); + printf("%o\n", (unsigned int)0x1234567890abcdef); + printf("%o\n", (unsigned long long)0x1234567890abcdef); + + printf("\n%o\n", (char)0x1234567890abcdef); + printf("%o\n", (short)0x1234567890abcdef); + printf("%o\n", (int)0x1234567890abcdef); + printf("%o\n", (long long)0x1234567890abcdef); + + printf("\n%p\n", (void *)0x12345678); + printf("%p\n", (int *)0x90abcdef); + printf("%p\n", (uintptr_t)0x67890abc); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d.out new file mode 100644 index 00000000..4d2bb112 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d.out @@ -0,0 +1,45 @@ + +239 +52719 +-1867788817 +1311768467294899695 + +239 +52719 +2427178479 +1311768467294899695 + +239 +52719 +2427178479 +1311768467294899695 + +239 +52719 +2427178479 +1311768467294899695 + +ef +cdef +90abcdef +1234567890abcdef + +ef +cdef +90abcdef +1234567890abcdef + +357 +146757 +22052746757 +110642547422052746757 + +357 +146757 +22052746757 +110642547422052746757 + +12345678 +90abcdef +67890abc + |