mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
34 lines
601 B
Nim
34 lines
601 B
Nim
discard """
|
|
output: '''ok'''
|
|
cmd: '''nim c --gc:orc -d:useMalloc -d:nimStressOrc $file'''
|
|
valgrind: "leaks"
|
|
"""
|
|
|
|
# bug #15753
|
|
|
|
type
|
|
NodeKind = enum
|
|
nkDancing,
|
|
nkColumn
|
|
|
|
DancingNode = ref object
|
|
right: DancingNode
|
|
column: DancingNode
|
|
kind: NodeKind
|
|
|
|
proc newColumnNode(): DancingNode =
|
|
result = DancingNode(kind: nkColumn)
|
|
result.right = result
|
|
result.column = result
|
|
|
|
proc createDLXList(): DancingNode =
|
|
result = newColumnNode()
|
|
|
|
for i in 0 .. 15:
|
|
let n = newColumnNode()
|
|
n.right = result.right
|
|
result = n
|
|
echo "ok"
|
|
|
|
var dlxlist = createDLXList()
|