summaryrefslogtreecommitdiffstats
path: root/testsuite/semko
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/semko')
-rwxr-xr-xtestsuite/semko/forty.stp4
-rwxr-xr-xtestsuite/semko/fortyone.stp3
-rwxr-xr-xtestsuite/semko/fortytwo.stp10
3 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/semko/forty.stp b/testsuite/semko/forty.stp
new file mode 100755
index 00000000..f7721a47
--- /dev/null
+++ b/testsuite/semko/forty.stp
@@ -0,0 +1,4 @@
+#! stap -p2
+
+global x
+probe kernel.function("sys_open") if (x = 1) { } # bad side-effect
diff --git a/testsuite/semko/fortyone.stp b/testsuite/semko/fortyone.stp
new file mode 100755
index 00000000..e9b986df
--- /dev/null
+++ b/testsuite/semko/fortyone.stp
@@ -0,0 +1,3 @@
+#! stap -p2
+
+probe kernel.function("sys_open") if (x > 1) { } # not a global
diff --git a/testsuite/semko/fortytwo.stp b/testsuite/semko/fortytwo.stp
new file mode 100755
index 00000000..17dacb1c
--- /dev/null
+++ b/testsuite/semko/fortytwo.stp
@@ -0,0 +1,10 @@
+#! stap -p2
+
+probe kernel.function("sys_open") if (foo(2)) { } # must not call functions
+
+function foo(x) { return x }
+
+# NB: If this condition is relaxed, then this will have to be blocked:
+# global y function foo () { return y++ } # since global y is written-to
+# but this one would be fine:
+# function foo () { return y++ } # since y is written-to