summary refs log tree commit diff stats
path: root/tests/trmacros/tnoalias.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/trmacros/tnoalias.nim')
-rw-r--r--tests/trmacros/tnoalias.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/trmacros/tnoalias.nim b/tests/trmacros/tnoalias.nim
new file mode 100644
index 000000000..1d5671362
--- /dev/null
+++ b/tests/trmacros/tnoalias.nim
@@ -0,0 +1,16 @@
+discard """
+  output: "23"
+"""
+
+template optslice{a = b + c}(a: expr{noalias}, b, c: expr): stmt =
+  a = b
+  inc a, c
+
+var
+  x = 12
+  y = 10
+  z = 13
+
+x = y+z
+
+echo x