aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/discard_m.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/programs/discard_m.zc')
-rw-r--r--tests/programs/discard_m.zc3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/programs/discard_m.zc b/tests/programs/discard_m.zc
new file mode 100644
index 0000000..35e9f3b
--- /dev/null
+++ b/tests/programs/discard_m.zc
@@ -0,0 +1,3 @@
+// m* on an unnamed u result lets the value be discarded; the plain call is an error
+.u mk(int v) { let p = new(1); p[0] = v; return u*p; }
+fn main() { m*mk(7); m*mk(8); put_n(7); put_c(10); return 0; }