aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-11-19 14:59:58 -0800
committerGraydon Hoare <[email protected]>2010-11-19 14:59:58 -0800
commit44a0c7225d5aa13769c4531b25fd524976c7f7a0 (patch)
tree5a7ead9d3317adf09f49d8f565b1c8343fdba147 /src/test
parentEnable more now-passing tests for rustc (including function calls). (diff)
downloadrust-44a0c7225d5aa13769c4531b25fd524976c7f7a0.tar.xz
rust-44a0c7225d5aa13769c4531b25fd524976c7f7a0.zip
Isolate while-header bug to minimal testcase, fix in rustboot, remove workaround in rustc.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/while-prelude-drop.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/run-pass/while-prelude-drop.rs b/src/test/run-pass/while-prelude-drop.rs
new file mode 100644
index 00000000..18f259a7
--- /dev/null
+++ b/src/test/run-pass/while-prelude-drop.rs
@@ -0,0 +1,22 @@
+tag t {
+ a;
+ b(str);
+}
+
+fn make(int i) -> t {
+ if (i > 10) {
+ ret a;
+ }
+ auto s = "hello";
+ // Ensure s is non-const.
+ s += "there";
+ ret b(s);
+}
+
+fn main() {
+ auto i = 0;
+ // The auto slot for the result of make(i) should not leak.
+ while (make(i) != a) {
+ i += 1;
+ }
+} \ No newline at end of file