mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-27 02:46:29 +00:00
(cherry picked from commit 7eb34d170a)
This commit is contained in:
33
tests/arc/torc_selfcycles.nim
Normal file
33
tests/arc/torc_selfcycles.nim
Normal file
@@ -0,0 +1,33 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user