diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/ChangeLog | 9 | ||||
-rwxr-xr-x | testsuite/parseko/foreachstmt06.stp | 12 | ||||
-rwxr-xr-x | testsuite/parseko/foreachstmt07.stp | 12 | ||||
-rwxr-xr-x | testsuite/parseok/foreachstmt01.stp | 10 | ||||
-rwxr-xr-x | testsuite/semko/foreachstmt01.stp | 12 | ||||
-rwxr-xr-x | testsuite/semko/foreachstmt02.stp | 17 |
6 files changed, 72 insertions, 0 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index e0bdd0d1..5ebaec26 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2006-11-06 David Smith <dsmith@redhat.com> + + * parseko/foreachstmt06.stp: Added new test for foreach "limit" + keyword. + * parseko/foreachstmt07.stp: Ditto. + * parseok/foreachstmt01.stp: Ditto. + * semko/foreachstmt01.stp: Ditto. + * semko/foreachstmt02.stp: Ditto. + 2006-11-02 Thang Nguyen <thang.p.nguyen@intel.com> * systemtap.samples/tcptest.exp: Put TCP load gen into a diff --git a/testsuite/parseko/foreachstmt06.stp b/testsuite/parseko/foreachstmt06.stp new file mode 100755 index 00000000..43addb90 --- /dev/null +++ b/testsuite/parseko/foreachstmt06.stp @@ -0,0 +1,12 @@ +#! stap -p1 + +# missing expression after limit + +global array + +function decl() +{ + array[0] = 1 + foreach (key in array limit) + printf("key %d, value %d\n", key, array[key]) +} diff --git a/testsuite/parseko/foreachstmt07.stp b/testsuite/parseko/foreachstmt07.stp new file mode 100755 index 00000000..a7a9c9b9 --- /dev/null +++ b/testsuite/parseko/foreachstmt07.stp @@ -0,0 +1,12 @@ +#! stap -p1 + +# missing limit keyword but with an expression + +global array + +function decl() +{ + array[0] = 1 + foreach (key in array 5) + printf("key %d, value %d\n", key, array[key]) +} diff --git a/testsuite/parseok/foreachstmt01.stp b/testsuite/parseok/foreachstmt01.stp new file mode 100755 index 00000000..2b306474 --- /dev/null +++ b/testsuite/parseok/foreachstmt01.stp @@ -0,0 +1,10 @@ +#! stap -p1 + +probe one +{ + foreach ([x+,y] in a limit 5) ; + n = 5 ; + foreach ([x,y-] in a limit n) ; + foreach ([x,y] in a+ limit n + 2) ; + foreach ([x,y] in a+ limit ++n) ; +} diff --git a/testsuite/semko/foreachstmt01.stp b/testsuite/semko/foreachstmt01.stp new file mode 100755 index 00000000..6797c8d6 --- /dev/null +++ b/testsuite/semko/foreachstmt01.stp @@ -0,0 +1,12 @@ +#! stap -p2 + +# limit keyword with string expression + +global array + +probe begin +{ + array[0] = 1 + foreach (key in array limit "hi") + printf("key %d, value %d\n", key, array[key]) +} diff --git a/testsuite/semko/foreachstmt02.stp b/testsuite/semko/foreachstmt02.stp new file mode 100755 index 00000000..49eea342 --- /dev/null +++ b/testsuite/semko/foreachstmt02.stp @@ -0,0 +1,17 @@ +#! stap -p2 + +# limit keyword with function returning a string expression + +global array + +function str_ret_type() +{ + return "hi" +} + +probe begin +{ + array[0] = 1 + foreach (key in array limit str_ret_type()) + printf("key %d, value %d\n", key, array[key]) +} |