diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-05-21 13:37:07 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-05-21 13:37:07 -0400 |
commit | e3339150b3c04f50b0abdc4a6d132a6b75b22cb6 (patch) | |
tree | c80892afd79625f95ff0a2543728804464c2961a /testsuite/systemtap.base/optim_arridx.stp | |
parent | 332ddc9f7354fe51c32c504087575b3ea2b70990 (diff) | |
parent | aa8a3b1797da54a14d04cd57758a65064056376e (diff) | |
download | systemtap-steved-e3339150b3c04f50b0abdc4a6d132a6b75b22cb6.tar.gz systemtap-steved-e3339150b3c04f50b0abdc4a6d132a6b75b22cb6.tar.xz systemtap-steved-e3339150b3c04f50b0abdc4a6d132a6b75b22cb6.zip |
Merge commit 'origin/master' into pr6429-comp-unwindsyms
* commit 'origin/master':
Fix assignment optimization expected results.
PR6538: more testsuite tweaks for read-only warnings
PR6538: more tapset fixes
PR6538: explain why absentstats.stp logs will contain warnings
PR6538: fix treatment of initialized globals
Use pointer_arg to fetch arguments for syscall.utime and compat_utime.
Optimize compound and binary expression assignments.
Check new (sub) functions of _struct_utimbuf_* and _struct_compat_utimbuf_*.
PR6538: tapset changes
PR6538: testsuite changes
PR5001: fix test suite collateral damage
PR6538: warn about read-only variables
Add some scripts and descriptions to the systemtap.examples.
PR5001: Remove _stp_ctime and always use ctime.
Use tr1/unordered_map instead of the deprecated ext/hash_map.
PR6524: ctime() on bad values hangs system.
Optimize away assignments in other contexts.
Optimize away assignments in other contexts.
dummy commit for testing systemtap-cvs notification
Remove sa_restorer initialization.
Diffstat (limited to 'testsuite/systemtap.base/optim_arridx.stp')
-rw-r--r-- | testsuite/systemtap.base/optim_arridx.stp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/optim_arridx.stp b/testsuite/systemtap.base/optim_arridx.stp new file mode 100644 index 00000000..20710c7f --- /dev/null +++ b/testsuite/systemtap.base/optim_arridx.stp @@ -0,0 +1,45 @@ +global arr1, arr2, arr3, elide_idx1, elide_global_a, elide_global_b + +function fna(a:long) {return a} +function fnb(a:long, b:long) {return a+b} + +probe begin { + // array indices + arr2[elide_idx1 = 1] = 10 + arr2[idx2 = 2] = 20 + arr2[elide_i=3] = 30 + arr2[j=4] = 40 + arr1[fna(k = 0), k] = 1 + arr1[b = 1, b] = 2 + arr1[elide_c = 2,2] = 3 + fnb(arr3[0] = 4, arr3[0]) + m = 1 + for (elide_n=2; m <= 10; m++) + arr2[m] = m * 10 + printf ("%d %d %d %d\n", arr1[0], arr2[0,0], idx2, j) + + // function args + aa = fna(elide_aa = 1) + bb = fnb(cc = 1, elide_global_a = 2) + + // loop + for (elide_bb = 1; bb < 10; bb++) + cc += bb + for (dd = 1; dd < 10; elide_ee = 1) + dd += 1 + + // conditional + if (elide_ff = 0) + elide_ff = 1 + if (elide_global_b = 1) + ee = 1 + + // compound assignment + cc = elide_gg=dd=5 + + // binary expression + cc = ((elide_hh = 4) + (cc = 1)) + + printf("%d %d %d %d %d", aa, bb, cc, dd, ee) + exit () +} |