summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorfche <fche>2006-01-24 17:58:02 +0000
committerfche <fche>2006-01-24 17:58:02 +0000
commitcbfbbf6996cbe3b9fe57ac2014aa7262bb6890d6 (patch)
tree89b507411bd828b12142f0962be3eb4a33c3a45d /testsuite
parent46746514a6943520ff73b6f77d35477e2abb30ba (diff)
downloadsystemtap-steved-cbfbbf6996cbe3b9fe57ac2014aa7262bb6890d6.tar.gz
systemtap-steved-cbfbbf6996cbe3b9fe57ac2014aa7262bb6890d6.tar.xz
systemtap-steved-cbfbbf6996cbe3b9fe57ac2014aa7262bb6890d6.zip
2006-01-24 Frank Ch. Eigler <fche@elastic.org>
PR 2060 etc. * tapsets.cxx (visit_target_symbol): Tolerate failed resolution by letting target_symbol instance pass through to optimizer and type checker. * elaborate.cxx (semantic_pass_optimize): New family of functions and associated visitor classes. (visit_for_loop): Tolerate absent init/incr clauses. (semantic_pass): Invoke unless unoptimized (-u) option given. * main.cxx, session.h: Add support for flag. * staptree.cxx (visit_for_loop): Tolerate absent init/incr clauses. (traversing_visitor::visit_arrayindex): Visit the index expressions. (functioncall_traversing_visitor): New class. (varuse_tracking_visitor): New class. * staptree.h: Corresponding changes. * parse.cxx (parse_for_loop): Represent absent init/incr expressions with null statement pointer instead of optimized-out dummy numbers. * stap.1.in: Document optimization. * testsuite/{semko,transko}/*.stp: Added "-u" or other code to many tests to check bad code without optimizer elision. * testsuite/semok/optimize.stp: New test. * elaborate.cxx (unresolved, invalid, mismatch): Standardize error message wording. * stapfuncs.5.in: Tweak print/printf docs. * tapset/logging.stp: Remove redundant "print" auxiliary function, since it's a translator built-in. * testsuite/transok/five.stp: Extend test. * translate.cxx (emit_symbol_data): Put symbol table into a separate temporary header file, to make "-p3" output easier on the eyes. * buildrun.cxx (compile_pass): Eliminate test-mode support throughout. * main.cxx, session.h, translate.cxx: Ditto. * main.cxx (main): For last-pass=2 runs, print post-optimization ASTs.
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/semko/eleven.stp12
-rwxr-xr-xtestsuite/semko/thirty.stp2
-rwxr-xr-xtestsuite/semko/thirtyone.stp2
-rwxr-xr-xtestsuite/semko/twenty.stp2
-rwxr-xr-xtestsuite/semko/twentyfive.stp2
-rwxr-xr-xtestsuite/semko/twentyfour.stp2
-rwxr-xr-xtestsuite/semko/twentynine.stp4
-rwxr-xr-xtestsuite/semko/twentyseven.stp2
-rwxr-xr-xtestsuite/semko/twentysix.stp2
-rwxr-xr-xtestsuite/semok/optimize.stp18
-rwxr-xr-xtestsuite/transko/one.stp4
-rwxr-xr-xtestsuite/transok/five.stp2
12 files changed, 37 insertions, 17 deletions
diff --git a/testsuite/semko/eleven.stp b/testsuite/semko/eleven.stp
index 34dfa225..f76c2df9 100755
--- a/testsuite/semko/eleven.stp
+++ b/testsuite/semko/eleven.stp
@@ -1,15 +1,15 @@
-#! stap -p2
+#! stap -up2
global arr,rra
-
+global s,n
probe begin {
arr[0]="value"
rra["key"]=0
}
probe end {
# confirm that typechecking works the same way for all array indexing
- if (k in arr) { k.""; arr[k]+0 }
- foreach (l in arr) { l.""; arr[l]+0 }
- if (m in rra) { m+1; rra[m]."" }
- foreach (n in rra) { n+0; rra[n]."" }
+ if (k in arr) { s=k.""; i=arr[k]+0 }
+ foreach (l in arr) { s=l.""; i=arr[l]+0 }
+ if (m in rra) { i=m+1; s=rra[m]."" }
+ foreach (n in rra) { i=n+0; s=rra[n]."" }
}
diff --git a/testsuite/semko/thirty.stp b/testsuite/semko/thirty.stp
index b145f826..57278af0 100755
--- a/testsuite/semko/thirty.stp
+++ b/testsuite/semko/thirty.stp
@@ -1,4 +1,4 @@
-#! stap -p2
+#! stap -up2
# need one of these for each prohibited statistic operation
diff --git a/testsuite/semko/thirtyone.stp b/testsuite/semko/thirtyone.stp
index 0462d4d5..dcb4fa7e 100755
--- a/testsuite/semko/thirtyone.stp
+++ b/testsuite/semko/thirtyone.stp
@@ -1,4 +1,4 @@
-#! stap -p2
+#! stap -up2
# need one of these for each prohibited statistic operation
diff --git a/testsuite/semko/twenty.stp b/testsuite/semko/twenty.stp
index 899efdc1..df12fa36 100755
--- a/testsuite/semko/twenty.stp
+++ b/testsuite/semko/twenty.stp
@@ -3,5 +3,5 @@
function a:string () { }
probe begin {
- a() + 1
+ print (a() + 1)
}
diff --git a/testsuite/semko/twentyfive.stp b/testsuite/semko/twentyfive.stp
index 8758bb67..5eb3b570 100755
--- a/testsuite/semko/twentyfive.stp
+++ b/testsuite/semko/twentyfive.stp
@@ -1,4 +1,4 @@
-#! stap -p2
+#! stap -up2
# need one of these for each prohibited statistic operation
diff --git a/testsuite/semko/twentyfour.stp b/testsuite/semko/twentyfour.stp
index ae75bf31..da6979bb 100755
--- a/testsuite/semko/twentyfour.stp
+++ b/testsuite/semko/twentyfour.stp
@@ -1,4 +1,4 @@
-#! stap -p2
+#! stap -up2
# need one of these for each prohibited statistic operation
diff --git a/testsuite/semko/twentynine.stp b/testsuite/semko/twentynine.stp
index b26e9872..19c66225 100755
--- a/testsuite/semko/twentynine.stp
+++ b/testsuite/semko/twentynine.stp
@@ -1,4 +1,4 @@
-#! stap -p2
+#! stap -up2
# need one of these for each prohibited statistic operation
@@ -6,6 +6,6 @@ global x
probe end
{
- x <<< 10 <<< 11
+ x <<< 10 <<< 11 # but see PR 1922
}
diff --git a/testsuite/semko/twentyseven.stp b/testsuite/semko/twentyseven.stp
index 6c5bd4f9..287ebebf 100755
--- a/testsuite/semko/twentyseven.stp
+++ b/testsuite/semko/twentyseven.stp
@@ -1,4 +1,4 @@
-#! stap -p2
+#! stap -up2
# need one of these for each prohibited statistic operation
diff --git a/testsuite/semko/twentysix.stp b/testsuite/semko/twentysix.stp
index 9ebffa4a..dd4bce51 100755
--- a/testsuite/semko/twentysix.stp
+++ b/testsuite/semko/twentysix.stp
@@ -1,4 +1,4 @@
-#! stap -p2
+#! stap -up2
# need one of these for each prohibited statistic operation
diff --git a/testsuite/semok/optimize.stp b/testsuite/semok/optimize.stp
new file mode 100755
index 00000000..28ccb46c
--- /dev/null
+++ b/testsuite/semok/optimize.stp
@@ -0,0 +1,18 @@
+#! stap -p2
+
+# We count on the optimizer to blow away these ridiculous
+# expressions, since they have no effect on the output.
+
+global b
+
+function zoo (x) {
+ return "tada" + x
+}
+
+probe begin {
+ b <<< "hello"
+ a = b + 2
+ zoo (zoo (5))
+ b = "goodbye"
+ no . $such . $target + $variable
+}
diff --git a/testsuite/transko/one.stp b/testsuite/transko/one.stp
index 3c69161d..508ce9d4 100755
--- a/testsuite/transko/one.stp
+++ b/testsuite/transko/one.stp
@@ -1,6 +1,6 @@
#! stap -p3
probe begin {
- 1 = a
- a+1 = 4
+ print (1 = a)
+ print (a+1 = 4)
}
diff --git a/testsuite/transok/five.stp b/testsuite/transok/five.stp
index 1b132409..db19b31f 100755
--- a/testsuite/transok/five.stp
+++ b/testsuite/transok/five.stp
@@ -13,5 +13,7 @@ probe begin
for (a=0; a<=4; a=a+1) { b = a }
while (99) next
+ while (99) break
+ while (99) continue
while (99) {}
}