summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/semko/fifteen.stp14
-rwxr-xr-xtestsuite/semko/fourteen.stp20
-rwxr-xr-xtestsuite/semko/thirteen.stp20
-rwxr-xr-xtestsuite/transok/eight.stp30
4 files changed, 84 insertions, 0 deletions
diff --git a/testsuite/semko/fifteen.stp b/testsuite/semko/fifteen.stp
new file mode 100755
index 00000000..612271db
--- /dev/null
+++ b/testsuite/semko/fifteen.stp
@@ -0,0 +1,14 @@
+#! stap -p2
+
+global tangle
+
+probe begin
+{
+ foreach (state in tangle)
+ {
+ state = tangle[state]++
+ }
+ printk("hello from systemtap")
+}
+
+
diff --git a/testsuite/semko/fourteen.stp b/testsuite/semko/fourteen.stp
new file mode 100755
index 00000000..16bd784b
--- /dev/null
+++ b/testsuite/semko/fourteen.stp
@@ -0,0 +1,20 @@
+#! stap -p2
+
+global foo
+
+function bar()
+{
+ a = foo["hello"]++
+ return 10
+}
+
+probe begin
+{
+ foreach (a in foo)
+ {
+ bar()
+ }
+ printk("hello from systemtap")
+}
+
+
diff --git a/testsuite/semko/thirteen.stp b/testsuite/semko/thirteen.stp
new file mode 100755
index 00000000..88761ded
--- /dev/null
+++ b/testsuite/semko/thirteen.stp
@@ -0,0 +1,20 @@
+#! stap -p2
+
+global foo
+
+function bar()
+{
+ foo["hello"] = 10
+ return 10
+}
+
+probe begin
+{
+ foreach (a in foo)
+ {
+ bar()
+ }
+ printk("hello from systemtap")
+}
+
+
diff --git a/testsuite/transok/eight.stp b/testsuite/transok/eight.stp
new file mode 100755
index 00000000..e703a5ae
--- /dev/null
+++ b/testsuite/transok/eight.stp
@@ -0,0 +1,30 @@
+#! stap -p3
+
+global foo
+global baz
+
+function bar()
+{
+ return foo["hello"]
+}
+
+probe begin
+{
+ foo["hello"] = 10
+ foreach (a in foo)
+ {
+ bar()
+ }
+
+ baz[1,"hello",a] = "chicken"
+ baz[1,"goodbye",a] = "supreme"
+
+ foreach ([x,y,z] in baz)
+ {
+ printk(baz[x,y,z] . y)
+ }
+
+ printk("hello from systemtap")
+}
+
+