aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/run-pass')
-rw-r--r--src/test/run-pass/alt-pattern-drop.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/run-pass/alt-pattern-drop.rs b/src/test/run-pass/alt-pattern-drop.rs
new file mode 100644
index 00000000..d1f1440f
--- /dev/null
+++ b/src/test/run-pass/alt-pattern-drop.rs
@@ -0,0 +1,19 @@
+// -*- rust -*-
+
+use std;
+import std._str;
+
+type t = tag(make_t(str), clam());
+
+fn main() {
+ let str s = "hi"; // ref up
+ let t x = make_t(s); // ref up
+
+ alt (x) {
+ case (make_t(y)) { log y; } // ref up and ref down
+ case (_) { log "?"; }
+ }
+
+ log _str.refcount(s);
+ check (_str.refcount(s) == 2u);
+}