summaryrefslogtreecommitdiffstats
path: root/testsuite/semko
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/semko')
-rwxr-xr-xtestsuite/semko/foreachstmt01.stp12
-rwxr-xr-xtestsuite/semko/foreachstmt02.stp17
2 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/semko/foreachstmt01.stp b/testsuite/semko/foreachstmt01.stp
new file mode 100755
index 00000000..6797c8d6
--- /dev/null
+++ b/testsuite/semko/foreachstmt01.stp
@@ -0,0 +1,12 @@
+#! stap -p2
+
+# limit keyword with string expression
+
+global array
+
+probe begin
+{
+ array[0] = 1
+ foreach (key in array limit "hi")
+ printf("key %d, value %d\n", key, array[key])
+}
diff --git a/testsuite/semko/foreachstmt02.stp b/testsuite/semko/foreachstmt02.stp
new file mode 100755
index 00000000..49eea342
--- /dev/null
+++ b/testsuite/semko/foreachstmt02.stp
@@ -0,0 +1,17 @@
+#! stap -p2
+
+# limit keyword with function returning a string expression
+
+global array
+
+function str_ret_type()
+{
+ return "hi"
+}
+
+probe begin
+{
+ array[0] = 1
+ foreach (key in array limit str_ret_type())
+ printf("key %d, value %d\n", key, array[key])
+}