summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.string/isinstr.stp
blob: 4688fe18d39bbd806f9fa714f9c74e9d70f4e460 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()
}