about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2011-03-03 15:19:26 -0800
committerGraydon Hoare <graydon@mozilla.com>2011-03-03 15:19:26 -0800
commit5c7db0cde15adfda5b43112ee86d4bfe3bd9ee82 (patch)
treeb4d391d5b0196cbcbd4f433742c5d6fad5e1e846 /src/test
parent7f74d4d4f2e0635d644be6e2259973b5cf559a2e (diff)
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 00000000000..8f0506469b1
--- /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 {
+  }
+}