summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.printf/bin.stp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.printf/bin.stp')
-rw-r--r--testsuite/systemtap.printf/bin.stp18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/systemtap.printf/bin.stp b/testsuite/systemtap.printf/bin.stp
new file mode 100644
index 00000000..ac86059d
--- /dev/null
+++ b/testsuite/systemtap.printf/bin.stp
@@ -0,0 +1,18 @@
+# test of 16-bit binary prints
+# need to use big_endian2() to get consistent results across
+# different-endian architectures.
+
+probe begin
+{
+ set_endian(2)
+ printf("%2b", 0x12)
+ printf("%2b", 0x34)
+ printf("%2b%2b", 0xabcd, 0x5678)
+ a = 0x12345678
+ b = 0xabcd
+ c = 0x8888
+ d = 0xcdef
+ printf("%2b%2b%2b%2b", a, b, c, d)
+ printf("a=%2b b=%2b c=%2b d=%2b",a,b,c,d)
+ exit()
+}