aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-03-03 15:19:26 -0800
committerGraydon Hoare <[email protected]>2011-03-03 15:19:26 -0800
commit5c7db0cde15adfda5b43112ee86d4bfe3bd9ee82 (patch)
treeb4d391d5b0196cbcbd4f433742c5d6fad5e1e846 /src/test
parentTurn on Valgrind for Mac (diff)
downloadrust-5c7db0cde15adfda5b43112ee86d4bfe3bd9ee82.tar.xz
rust-5c7db0cde15adfda5b43112ee86d4bfe3bd9ee82.zip
Rewrite rustboot's flow-graph wiring passes to be less awful. Add test for nested control-flow constructs.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/typestate-cfg-nesting.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/run-pass/typestate-cfg-nesting.rs b/src/test/run-pass/typestate-cfg-nesting.rs
new file mode 100644
index 00000000..8f050646
--- /dev/null
+++ b/src/test/run-pass/typestate-cfg-nesting.rs
@@ -0,0 +1,26 @@
+
+fn f() {
+
+ auto x = 10;
+ auto y = 11;
+ if (true) {
+ alt (x) {
+ case (_) {
+ y = x;
+ }
+ }
+ } else {
+ }
+}
+
+fn main() {
+
+ auto x = 10;
+ auto y = 11;
+ if (true) {
+ while (false) {
+ y = x;
+ }
+ } else {
+ }
+}