diff options
author | graydon <graydon> | 2005-07-23 02:50:14 +0000 |
---|---|---|
committer | graydon <graydon> | 2005-07-23 02:50:14 +0000 |
commit | 67c0a57949358f8e708361ce93ef3ccc0ea8ef93 (patch) | |
tree | 1268285cc9ef661824c565aee3503b30667bd4b5 /testsuite/transok | |
parent | beb816a08698ceaf39910ab40f08beba6c8edb6e (diff) | |
download | systemtap-steved-67c0a57949358f8e708361ce93ef3ccc0ea8ef93.tar.gz systemtap-steved-67c0a57949358f8e708361ce93ef3ccc0ea8ef93.tar.xz systemtap-steved-67c0a57949358f8e708361ce93ef3ccc0ea8ef93.zip |
2005-07-22 Graydon Hoare <graydon@redhat.com>
* translate.cxx (itervar): New class.
(*::visit_foreach_loop): Implement.
Various bug fixes.
* staptree.cxx (deep_copy_visitor::*): Copy tok fields.
* elaborate.cxx (lvalue_aware_traversing_visitor):
(mutated_map_collector):
(no_map_mutation_during_iteration_check): New classes.
(semantic_pass_maps): New function to check map usage.
(semantic_pass): Call it.
* testsuite/transok/eight.stp: Test 'foreach' loop translation.
* testsuite/semko/{thirteen,fourteen,fifteen}.stp:
Test prohibited forms of foreach loops.
Diffstat (limited to 'testsuite/transok')
-rwxr-xr-x | testsuite/transok/eight.stp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/transok/eight.stp b/testsuite/transok/eight.stp new file mode 100755 index 00000000..e703a5ae --- /dev/null +++ b/testsuite/transok/eight.stp @@ -0,0 +1,30 @@ +#! stap -p3 + +global foo +global baz + +function bar() +{ + return foo["hello"] +} + +probe begin +{ + foo["hello"] = 10 + foreach (a in foo) + { + bar() + } + + baz[1,"hello",a] = "chicken" + baz[1,"goodbye",a] = "supreme" + + foreach ([x,y,z] in baz) + { + printk(baz[x,y,z] . y) + } + + printk("hello from systemtap") +} + + |