torc_selfcycles.nim 601 B

12345678910111213141516171819202122232425262728293031323334
  1. discard """
  2. output: '''ok'''
  3. cmd: '''nim c --gc:orc -d:useMalloc -d:nimStressOrc $file'''
  4. valgrind: "leaks"
  5. """
  6. # bug #15753
  7. type
  8. NodeKind = enum
  9. nkDancing,
  10. nkColumn
  11. DancingNode = ref object
  12. right: DancingNode
  13. column: DancingNode
  14. kind: NodeKind
  15. proc newColumnNode(): DancingNode =
  16. result = DancingNode(kind: nkColumn)
  17. result.right = result
  18. result.column = result
  19. proc createDLXList(): DancingNode =
  20. result = newColumnNode()
  21. for i in 0 .. 15:
  22. let n = newColumnNode()
  23. n.right = result.right
  24. result = n
  25. echo "ok"
  26. var dlxlist = createDLXList()