mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
Add test for #1081
This commit is contained in:
17
tests/ccgbugs/tbug1081.nim
Normal file
17
tests/ccgbugs/tbug1081.nim
Normal file
@@ -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`
|
||||
Reference in New Issue
Block a user