diff options
Diffstat (limited to 'testsuite/systemtap.string/isinstr.stp')
-rw-r--r-- | testsuite/systemtap.string/isinstr.stp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/systemtap.string/isinstr.stp b/testsuite/systemtap.string/isinstr.stp new file mode 100644 index 00000000..4688fe18 --- /dev/null +++ b/testsuite/systemtap.string/isinstr.stp @@ -0,0 +1,25 @@ +probe begin +{ + a = "foo" + str = "abcfoobad" + + if (isinstr(str,a)) + printf("\"%s\" is in \"%s\"\n", a, str) + else + printf("\"%s\" is NOT in \"%s\"\n", a, str) + + str = "abcdefg" + if (isinstr(str,a)) + printf("\"%s\" is in \"%s\"\n", a, str) + else + printf("\"%s\" is NOT in \"%s\"\n", a, str) + + a = "" + str = "" + if (isinstr(str,a)) + printf("\"%s\" is in \"%s\"\n", a, str) + else + printf("\"%s\" is NOT in \"%s\"\n", a, str) + + exit() +} |