summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/global_vars.stp
diff options
context:
space:
mode:
authorAnanth N Mavinakayanahalli <ananth@in.ibm.com>2008-05-14 10:56:37 +0530
committerAnanth N Mavinakayanahalli <ananth@in.ibm.com>2008-05-14 10:56:37 +0530
commitc3799d720b60bd74a60de4addcd0d77a90f7842a (patch)
tree82fbc6b86cb105f9bf3b9cfa4e4c6d371abaaee8 /testsuite/systemtap.base/global_vars.stp
parent838cd09eb9134f49a4f290ae5f615edff781f153 (diff)
downloadsystemtap-steved-c3799d720b60bd74a60de4addcd0d77a90f7842a.tar.gz
systemtap-steved-c3799d720b60bd74a60de4addcd0d77a90f7842a.tar.xz
systemtap-steved-c3799d720b60bd74a60de4addcd0d77a90f7842a.zip
PR 5955 - Accept ; terminated globals
Diffstat (limited to 'testsuite/systemtap.base/global_vars.stp')
-rw-r--r--testsuite/systemtap.base/global_vars.stp57
1 files changed, 57 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/global_vars.stp b/testsuite/systemtap.base/global_vars.stp
new file mode 100644
index 00000000..737e2556
--- /dev/null
+++ b/testsuite/systemtap.base/global_vars.stp
@@ -0,0 +1,57 @@
+/*
+ * global_vars.stp
+ *
+ * Check that global variables with a ; termination work fine
+ */
+
+probe begin { println("systemtap starting probe") }
+probe end { println("systemtap ending probe") }
+
+global a;
+global c, d;
+global g = 42;
+global e[1], f;
+global gstr = "foobar";
+
+global gstr_saved;
+probe begin(-9223372036854775808) {
+ c = g
+ d = c + g
+ a = d
+ f = c
+ e[0] = "a";
+ gstr_saved = gstr
+}
+
+probe end {
+ if (c == 42)
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - c:%d != 42\n", c)
+
+ if (d == (c + g))
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - d:%d != %d\n", d, (c+g))
+
+ if (a == d)
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - a:%d != %d\n", a, d)
+
+ if (f == c)
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - f:%d != %d\n", f, c)
+
+ if (e[0] == "a")
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - e:%s != a\n", e[0])
+
+ if (gstr_saved == "foobar")
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - gstr_saved:%s != foobar\n", gstr_saved)
+}
+