diff options
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/buildok/pmap_foreach.stp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/buildok/pmap_foreach.stp b/testsuite/buildok/pmap_foreach.stp new file mode 100755 index 00000000..8cc8decd --- /dev/null +++ b/testsuite/buildok/pmap_foreach.stp @@ -0,0 +1,22 @@ +#! stap -p4 + +global foo + + +probe begin { + for (i=0;i<10;i+=2) { + foo[1] <<< i + foo[2] <<< i*i + foo[3] <<< i*i*i + } + foo[3] <<< 4*4*4 + exit() +} + +probe end { + for (i=1;i<4;i++) + printf("count of foo[%d] = %d\n", i, @count(foo[i])) + + foreach (i in foo) + printf("count of foo[%d] = %d\n", i, @count(foo[i])) +} |