summaryrefslogtreecommitdiffstats
path: root/testsuite/transok/one.stp
diff options
context:
space:
mode:
authorfche <fche>2005-06-08 22:02:09 +0000
committerfche <fche>2005-06-08 22:02:09 +0000
commitbb2e3076ea20631d4606050550bc9664204f2c62 (patch)
treeef9cfb841ddb001c1f3aa266523f1ff6f56b21b5 /testsuite/transok/one.stp
parent22f4623195facb4cbc1b50c45c0bd689f6958a9d (diff)
downloadsystemtap-steved-bb2e3076ea20631d4606050550bc9664204f2c62.tar.gz
systemtap-steved-bb2e3076ea20631d4606050550bc9664204f2c62.tar.xz
systemtap-steved-bb2e3076ea20631d4606050550bc9664204f2c62.zip
2005-06-08 Frank Ch. Eigler <fche@redhat.com>
systemtap/916 Implement all basic scalar operators, including modify-assignment. * parse.cxx (lexer): Allow multi-character lookahead in order to scan 1/2/3-character operators. (parse_boolean_or/and/xor/shift): New routines. * translate.cxx (visit_assignment, visit_binary_expression, visit_*_crement): Generally rewrote. (visit_*): Added more parentheses in output. (emit_module_init): Initialize globals. * staptree.h, elaborate.cxx, elaborate.h: Remove exponentiation. * main.cxx (main): Add an end-of-line to output file. * testsuite/*: Several new tests.
Diffstat (limited to 'testsuite/transok/one.stp')
-rwxr-xr-xtestsuite/transok/one.stp56
1 files changed, 56 insertions, 0 deletions
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
+}