aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
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