diff options
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/parseok/eleven.stp | 54 | ||||
-rwxr-xr-x | testsuite/parseok/ten.stp | 14 | ||||
-rwxr-xr-x | testsuite/transok/five.stp | 2 | ||||
-rwxr-xr-x | testsuite/transok/one.stp | 56 | ||||
-rwxr-xr-x | testsuite/transok/three.stp | 7 | ||||
-rwxr-xr-x | testsuite/transok/two.stp | 2 |
6 files changed, 122 insertions, 13 deletions
diff --git a/testsuite/parseok/eleven.stp b/testsuite/parseok/eleven.stp new file mode 100755 index 00000000..c05ca66f --- /dev/null +++ b/testsuite/parseok/eleven.stp @@ -0,0 +1,54 @@ +#! stap -p1 + +probe two +{ + # all assignment operators + a = b + a <<< b + a += b + a -= b + a *= b + a /= b + a %= b + a <<= b + a >>= b + a &= b + a ^= b + a |= b + + # all ternary operators + a ? b : c + + # all binary operators + a || b + a && b + a | b + a & b + a ^ b + a < b + a > b + a == b + a != b + a <= b + a >= b + a << b + a >> b + a . b + a + b + a - b + a * b + a / b + a % b + + # all unary operators + a ++ + a -- + -- a + ++ a + ~ a + ! a + ; # grammar glitch + + a + ; # grammar glitch + - a +} diff --git a/testsuite/parseok/ten.stp b/testsuite/parseok/ten.stp index 25d16e62..2da82f04 100755 --- a/testsuite/parseok/ten.stp +++ b/testsuite/parseok/ten.stp @@ -4,13 +4,13 @@ probe two { for (;;) ; for (a=0;;) { a + 4; break } - for (;a>0;) { a + 5; continue } - for (;;a++) { a + 5 } - for (a=0;a>0;) { a + 4 } - for (;a>0;a++) { a + 5 } - for (a=0;;a++) { a + 5 } - for (a=0; a<=4; a++) ; - for (a=0; a<=4; a++) { b = a } + for (;a>0;) { a ^ 5; continue } + for (;;a++) { a | 5 } + for (a=0;a>0;) { a << 4 } + for (;a>0;++a) { a >> 5 } + for (a=0;;a--) { a & 5 * b } + for (a=0; a<=4 && b>=5; --a) ; + for (a=0; a==4 || b!=5; a++) { b = a } next while (99) ; while (99) { break continue } diff --git a/testsuite/transok/five.stp b/testsuite/transok/five.stp index 266b3408..5cd50cb6 100755 --- a/testsuite/transok/five.stp +++ b/testsuite/transok/five.stp @@ -1,6 +1,6 @@ #! stap -probe two +probe begin { for (;;) ; for (a=0;;) { if (a > 4) break } diff --git a/testsuite/transok/one.stp b/testsuite/transok/one.stp new file mode 100755 index 00000000..6c624f14 --- /dev/null +++ b/testsuite/transok/one.stp @@ -0,0 +1,56 @@ +#! stap -p3 + +probe begin +{ + # all assignment operators + a = b + # a <<< b + a += b + a -= b + a *= b + a /= b + a %= b + a <<= b + a >>= b + a &= b + a ^= b + a |= b + + # all ternary operators + a ? b : c + + # all binary operators + a || b + a && b + a | b + a & b + a ^ b + a < b + a > b + a == b + a != b + a <= b + a >= b + a << b + a >> b + as . bs + as == bs # overload operators for strings + as != bs + a + b + a - b + a * b + a / b + a % b + + # all unary operators + a ++ + a -- + -- a + -- b + ~ a + ! a + ; # grammar glitch + + a + ; # grammar glitch + - a +} diff --git a/testsuite/transok/three.stp b/testsuite/transok/three.stp index c372b271..07703f90 100755 --- a/testsuite/transok/three.stp +++ b/testsuite/transok/three.stp @@ -5,7 +5,7 @@ function f1 (a, b) { d = "hello"; # poo[c] = bab[d] = "hi" bab = "hi"; - bab = poo[c]; + # bab = poo[c]; return 0 } @@ -14,14 +14,13 @@ function f2 () { } global koo -global poo, bab -probe z { +probe begin { f2 (); koo = 1 } -probe x,y { +probe begin, end { f2 (); f1 (f1 (3 * 2 + 1, "foo"), "canoe") } diff --git a/testsuite/transok/two.stp b/testsuite/transok/two.stp index d62e88a8..848934a7 100755 --- a/testsuite/transok/two.stp +++ b/testsuite/transok/two.stp @@ -1,5 +1,5 @@ #! stap -probe k,l { 2; } +probe begin, end { 2; } function poo (zoo) { n = poo2 (8); return "foo" . zoo } function poo2 (zoo) { return poo3 (2 + 4 * zoo) } function poo3 (zoo) { return zoo } |