summary refs log tree commit diff stats
path: root/tests/ccgbugs/tbug1081.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ccgbugs/tbug1081.nim')
-rw-r--r--tests/ccgbugs/tbug1081.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ccgbugs/tbug1081.nim b/tests/ccgbugs/tbug1081.nim
new file mode 100644
index 000000000..71628feec
--- /dev/null
+++ b/tests/ccgbugs/tbug1081.nim
@@ -0,0 +1,17 @@
+discard """
+  output: '''1
+0
+0
+0'''
+"""
+
+proc `1/1`() = echo(1 div 1)
+template `1/2`() = echo(1 div 2)
+var `1/3` = 1 div 4
+`1/3` = 1 div 3 # oops, 1/3!=1/4
+let `1/4` = 1 div 4
+
+`1/1`()
+`1/2`()
+echo `1/3`
+echo `1/4`