Files
Nim/tests/dll/server.nim
Timothee Cour 89a15e417d CI openbsd: 3x batching via NIM_TESTAMENT_BATCH ; overall CI finishes in 21m instead of 34m (#14851)
* CI openbsd: 2x batching via NIM_TESTAMENT_BATCH

* auto-generate .builds/openbsd_x.yml to avoid code duplication

* 3x batching
2020-06-30 14:21:30 +02:00

28 lines
739 B
Nim

discard """
action: compile
cmd: "nim $target --debuginfo --hints:on --define:useNimRtl --app:lib $options $file"
batchable: false
"""
type
TNodeKind = enum nkLit, nkSub, nkAdd, nkDiv, nkMul
TNode = object
case k: TNodeKind
of nkLit: x: int
else: a, b: ref TNode
PNode = ref TNode
proc newLit(x: int): PNode {.exportc: "newLit", dynlib.} =
result = PNode(k: nkLit, x: x)
proc newOp(k: TNodeKind, a, b: PNode): PNode {.exportc: "newOp", dynlib.} =
assert a != nil
assert b != nil
result = PNode(k: nkSub, a: a, b: b)
# now overwrite with the real value:
result.k = k
proc buildTree(x: int): PNode {.exportc: "buildTree", dynlib.} =
result = newOp(nkMul, newOp(nkAdd, newLit(x), newLit(x)), newLit(x))