summaryrefslogtreecommitdiffstats
path: root/runtime/tests/string/printf_B.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-05-19 05:25:26 +0000
committerhunt <hunt>2005-05-19 05:25:26 +0000
commit7edfd9e24568502f54175b08da4168f2af6642fe (patch)
treeaa2d578a4d7d99fef111a179e51a90198be0f2c1 /runtime/tests/string/printf_B.c
parent752870c4bea5f43859ec4e10ae2579018908bbe3 (diff)
downloadsystemtap-steved-7edfd9e24568502f54175b08da4168f2af6642fe.tar.gz
systemtap-steved-7edfd9e24568502f54175b08da4168f2af6642fe.tar.xz
systemtap-steved-7edfd9e24568502f54175b08da4168f2af6642fe.zip
Add String test files.
Diffstat (limited to 'runtime/tests/string/printf_B.c')
-rw-r--r--runtime/tests/string/printf_B.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/runtime/tests/string/printf_B.c b/runtime/tests/string/printf_B.c
new file mode 100644
index 00000000..b9bbe170
--- /dev/null
+++ b/runtime/tests/string/printf_B.c
@@ -0,0 +1,37 @@
+/* more printf tests */
+
+/* use very small buffer size for testing */
+#define STP_PRINT_BUF_LEN 20
+#include "runtime.h"
+
+#define LLONG_MAX 9223372036854775807LL
+#define LLONG_MIN (-LLONG_MAX - 1LL)
+
+
+int main ()
+{
+ int i;
+
+ /* a couple of loops showing continuous output */
+ for (i = 0; i < 20; i++)
+ _stp_sprintf(_stp_stdout, "i=%d ", i);
+ _stp_printf("\n");
+ _stp_print_flush();
+
+ for (i = 0; i < 5; i++)
+ _stp_printf("[%d %d %d] ", i, i*i, i*i*i);
+ _stp_printf("\n");
+ _stp_print_flush();
+
+ int64_t x,y;
+ x = LLONG_MAX;
+ y = LLONG_MIN;
+
+ _stp_printf("%lld ",x);
+ _stp_printf("(%llx) ", x);
+ _stp_printf("%lld ",y);
+ _stp_printf("(%llx) ", y);
+ _stp_printf("\n");
+ _stp_print_flush();
+ return 0;
+}