Blob Blame History Raw
commit 488adf462bbbba541d2ee4448a9c30458084cfb8
Author: Aaron Merey <amerey@redhat.com>
Date:   Wed Jun 20 18:42:53 2018 -0400

    testsuite: fix formatting of bpf test increment2.stp

diff --git a/testsuite/systemtap.bpf/bpf_tests/increment2.stp b/testsuite/systemtap.bpf/bpf_tests/increment2.stp
index ccc2609fa..89c5f1d07 100644
--- a/testsuite/systemtap.bpf/bpf_tests/increment2.stp
+++ b/testsuite/systemtap.bpf/bpf_tests/increment2.stp
@@ -1,18 +1,48 @@
+global flag
 probe begin {
+	printf("BEGIN\n")
 	a = 0; b = 0; c = 0;
        	d = 0; e = 0; f = 0;
        	g = 0; h = 0
 
-#	a = a + a++
-#	b = b + ++b
-#	c = ++c + c
-#	d = ++d + ++c
-#	e = ++e + e++
-#	f = f++ + f
-#	g = g++ + ++g
-#	h = h++ + h++
-	printf("%d %d %d ", a,b,c)
-	printf("%d %d %d ", d,e,f)
-	printf("%d %d\n", g,h)
+	a = a + a++
+	b = b + ++b
+	c = ++c + c
+	d = ++d + ++c
+	e = ++e + e++
+	f = f++ + f
+	g = g++ + ++g
+	h = h++ + h++
+
+	if (a == 0 && b == 1 && c == 3 && d == 4 
+            && e == 2 && f == 1 && g == 2 && h == 1)
+          flag = 1
+}
+
+probe kernel.function("sys_read") {
+	a = 0; b = 0; c = 0;
+       	d = 0; e = 0; f = 0;
+       	g = 0; h = 0
+
+	a = a + a++
+	b = b + ++b
+	c = ++c + c
+	d = ++d + ++c
+	e = ++e + e++
+	f = f++ + f
+	g = g++ + ++g
+	h = h++ + h++
+
+	if (a != 0 || b != 1 || c != 3 || d != 4
+            || e != 2 || f != 1 || g != 2 || h != 1)
+	  flag = 0
+
         exit()
 }
+
+probe end {
+	if (flag)
+          printf("END PASS\n")
+	else
+	  printf("END FAIL\n")
+}