diff options
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/buildko/one.stp | 17 | ||||
-rwxr-xr-x | testsuite/buildok/one.stp | 16 | ||||
-rwxr-xr-x | testsuite/buildok/two.stp | 16 | ||||
-rwxr-xr-x | testsuite/parseko/ten.stp | 5 | ||||
-rwxr-xr-x | testsuite/parseok/nine.stp | 4 | ||||
-rwxr-xr-x | testsuite/parseok/twelve.stp | 9 | ||||
-rwxr-xr-x | testsuite/semok/transko.stp | 10 | ||||
-rwxr-xr-x | testsuite/transko/one.stp | 2 | ||||
-rwxr-xr-x | testsuite/transko/two.stp | 3 | ||||
-rwxr-xr-x | testsuite/transok/nine.stp | 12 |
10 files changed, 90 insertions, 4 deletions
diff --git a/testsuite/buildko/one.stp b/testsuite/buildko/one.stp new file mode 100755 index 00000000..b8d54c51 --- /dev/null +++ b/testsuite/buildko/one.stp @@ -0,0 +1,17 @@ +#! stap -p4 + +%{ +#include <linux/version.h> +%} + +function get_release () %{ +/* this is a type error, detected by gcc */ +THIS->__retvalue = 5; +%} + +probe begin +{ + printk("hello from systemtap, kernel version " . get_release()) +} + + diff --git a/testsuite/buildok/one.stp b/testsuite/buildok/one.stp new file mode 100755 index 00000000..1f4f8f9b --- /dev/null +++ b/testsuite/buildok/one.stp @@ -0,0 +1,16 @@ +#! stap -p4 + +global foo, bar + +probe begin +{ + x = 10 + foo["hello"] = 25 + foo["hello"]++ + ++foo["hello"] + x = foo["hello"] + foo["yo"] *= bar[x, foo["hello"], "goodbye"]++; + printk("hello from systemtap") +} + + diff --git a/testsuite/buildok/two.stp b/testsuite/buildok/two.stp new file mode 100755 index 00000000..83a4705c --- /dev/null +++ b/testsuite/buildok/two.stp @@ -0,0 +1,16 @@ +#! stap -p4 + +%{ +#include <linux/version.h> +%} + +function get_release () %{ +strncpy(THIS->__retvalue, UTS_RELEASE, MAXSTRINGLEN); +%} + +probe begin +{ + printk("hello from systemtap, kernel version " . get_release()) +} + + diff --git a/testsuite/parseko/ten.stp b/testsuite/parseko/ten.stp new file mode 100755 index 00000000..a268db4e --- /dev/null +++ b/testsuite/parseko/ten.stp @@ -0,0 +1,5 @@ +#! stap -p1 + +probe foo { + %{ /* not a valid place for embedded code */ %} +} diff --git a/testsuite/parseok/nine.stp b/testsuite/parseok/nine.stp index 13e40cbf..3582907a 100755 --- a/testsuite/parseok/nine.stp +++ b/testsuite/parseok/nine.stp @@ -9,7 +9,7 @@ probe two { a = b c = d - e = f(); - g = h; + _e = $f(); + _g = h_; ; } diff --git a/testsuite/parseok/twelve.stp b/testsuite/parseok/twelve.stp new file mode 100755 index 00000000..5b8a3932 --- /dev/null +++ b/testsuite/parseok/twelve.stp @@ -0,0 +1,9 @@ +#! stap -p1 + +%{ +/* hello world */ +%} + +function foo (p1, p2) %{ + /* goodbye world */ +%} diff --git a/testsuite/semok/transko.stp b/testsuite/semok/transko.stp new file mode 100755 index 00000000..9c78c6ef --- /dev/null +++ b/testsuite/semok/transko.stp @@ -0,0 +1,10 @@ +#! /bin/sh + +# make sure that we can *semcheck* all transko test files, to ensure +# that it is translation-time checks that fail, not earlier ones errors + +set -e +for file in ${SRCDIR}/testsuite/transko/*.stp +do + ./stap -p2 $file +done diff --git a/testsuite/transko/one.stp b/testsuite/transko/one.stp index b6bb3e89..3c69161d 100755 --- a/testsuite/transko/one.stp +++ b/testsuite/transko/one.stp @@ -1,6 +1,6 @@ #! stap -p3 -probe foo { +probe begin { 1 = a a+1 = 4 } diff --git a/testsuite/transko/two.stp b/testsuite/transko/two.stp index 77e1f6d0..5185281a 100755 --- a/testsuite/transko/two.stp +++ b/testsuite/transko/two.stp @@ -2,9 +2,10 @@ function bar () { next + return 0 } -probe foo { +probe end { break for (a=0; a<10; a=a+1) for (b=0; b<10; b=b+1) ; continue diff --git a/testsuite/transok/nine.stp b/testsuite/transok/nine.stp new file mode 100755 index 00000000..a75fad5e --- /dev/null +++ b/testsuite/transok/nine.stp @@ -0,0 +1,12 @@ +#! stap -p3 + +%{ +void just_some_declaration () {} +%} + +function bar(foo) %{ just_some_declaration(); THIS->__retvalue = THIS->foo + 5; %} + +probe begin +{ + bar (5) + 0 +} |