diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-09-23 19:05:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-23 13:05:05 +0200 |
commit | 7739e23420c9a7a4ec7eccdddc0a39df9e905aa8 (patch) | |
tree | c2ec38a9dfa480a1bf8908ad95fa7212f7b9d78f /tests/stdlib | |
parent | 47b59e4d3315dbcb0b17d305f43cc35e4eb89e51 (diff) | |
download | Nim-7739e23420c9a7a4ec7eccdddc0a39df9e905aa8.tar.gz |
defaults to ORC (#19972)
* defaults to Orc * bootstrap using refc * use gc * init orc defines * unregister orc * fix gc * fix commands * add prepareMutation for orc * enable deepcopy for orc * prepareMutation * more fixes * some cases * bug #20081 * partial fixes * partial fixes * fixes command line * more fixes * build Nim with refc * use gc * more fixes * rstore * orc doesn't support threadpool * more shallowCopy * more fixes * fixes unsafeNew * workarounds * small * more fixes * fixes some megatest * tcodegenbugs1 refc * fxies megatest * build nimble with refc * workaround tensordsl tests * replace shallowCopy with move * fixes action * workaround * add todo * fixes important packages * unpublic unregisterArcOrc * fixes cpp * enable windows Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/mgenast.nim | 4 | ||||
-rw-r--r-- | tests/stdlib/tgenast.nim | 4 | ||||
-rw-r--r-- | tests/stdlib/thttpclient_ssl.nim | 2 | ||||
-rw-r--r-- | tests/stdlib/tjson.nim | 3 | ||||
-rw-r--r-- | tests/stdlib/tmitems.nim | 2 | ||||
-rw-r--r-- | tests/stdlib/tstdlib_various.nim | 1 | ||||
-rw-r--r-- | tests/stdlib/tstring.nim | 1 | ||||
-rw-r--r-- | tests/stdlib/twchartoutf8.nim | 3 |
8 files changed, 16 insertions, 4 deletions
diff --git a/tests/stdlib/mgenast.nim b/tests/stdlib/mgenast.nim index 2b5381891..b0904847e 100644 --- a/tests/stdlib/mgenast.nim +++ b/tests/stdlib/mgenast.nim @@ -31,6 +31,8 @@ macro bindme6UseExpose*(): untyped = genAst: var tst = "sometext" var ss = newStringStream("anothertext") + when defined(gcArc) or defined(gcOrc): + prepareMutation(tst) writeData(ss, tst[0].addr, 2) discard readData(ss, tst[0].addr, 2) @@ -40,6 +42,8 @@ macro bindme6UseExposeFalse*(): untyped = genAstOpt({kDirtyTemplate}, newStringStream, writeData, readData): var tst = "sometext" var ss = newStringStream("anothertext") + when defined(gcArc) or defined(gcOrc): + prepareMutation(tst) writeData(ss, tst[0].addr, 2) discard readData(ss, tst[0].addr, 2) diff --git a/tests/stdlib/tgenast.nim b/tests/stdlib/tgenast.nim index 0904b83dd..26264744b 100644 --- a/tests/stdlib/tgenast.nim +++ b/tests/stdlib/tgenast.nim @@ -1,3 +1,7 @@ +discard """ + matrix: "--mm:orc; --mm:refc" +""" + # xxx also test on js import std/genasts diff --git a/tests/stdlib/thttpclient_ssl.nim b/tests/stdlib/thttpclient_ssl.nim index 3acdacfe3..cf0485b12 100644 --- a/tests/stdlib/thttpclient_ssl.nim +++ b/tests/stdlib/thttpclient_ssl.nim @@ -1,5 +1,5 @@ discard """ - cmd: "nim $target --threads:on -d:ssl $options $file" + cmd: "nim $target --mm:refc -d:ssl $options $file" disabled: "openbsd" """ diff --git a/tests/stdlib/tjson.nim b/tests/stdlib/tjson.nim index 336558ff3..3fbb4b531 100644 --- a/tests/stdlib/tjson.nim +++ b/tests/stdlib/tjson.nim @@ -1,4 +1,5 @@ discard """ + matrix: "--mm:refc" targets: "c cpp js" """ @@ -49,7 +50,7 @@ for i in 0 .. 10000: except: discard # memory diff should less than 4M -doAssert(abs(getOccupiedMem() - startMemory) < 4 * 1024 * 1024) +doAssert(abs(getOccupiedMem() - startMemory) < 4 * 1024 * 1024) # todo fixme doesn;t work for ORC # test `$` diff --git a/tests/stdlib/tmitems.nim b/tests/stdlib/tmitems.nim index c0ced7cab..171604e33 100644 --- a/tests/stdlib/tmitems.nim +++ b/tests/stdlib/tmitems.nim @@ -62,6 +62,7 @@ block: block: var x = "foobar" + prepareMutation(x) var y = cast[cstring](addr x[0]) for c in y.mitems: inc c @@ -75,6 +76,7 @@ block: block: var x = "foobar" + prepareMutation(x) var y = cast[cstring](addr x[0]) for i, c in y.mpairs: inc c, i diff --git a/tests/stdlib/tstdlib_various.nim b/tests/stdlib/tstdlib_various.nim index bc90d6ef4..4efc5a57e 100644 --- a/tests/stdlib/tstdlib_various.nim +++ b/tests/stdlib/tstdlib_various.nim @@ -1,4 +1,5 @@ discard """ +matrix: "--mm:refc" output: ''' abc def diff --git a/tests/stdlib/tstring.nim b/tests/stdlib/tstring.nim index 3e2ccb251..ce309626e 100644 --- a/tests/stdlib/tstring.nim +++ b/tests/stdlib/tstring.nim @@ -1,4 +1,5 @@ discard """ + matrix: "--mm:refc" targets: "c cpp js" """ diff --git a/tests/stdlib/twchartoutf8.nim b/tests/stdlib/twchartoutf8.nim index a6602e3e3..3182ee46a 100644 --- a/tests/stdlib/twchartoutf8.nim +++ b/tests/stdlib/twchartoutf8.nim @@ -66,8 +66,7 @@ else: #RFC-2781 "UTF-16, an encoding of ISO 10646" - var wc: WideCString - unsafeNew(wc, 1024 * 4 + 2) + var wc: WideCString = newWideCString(1024 * 2) #U+0000 to U+D7FF #skip the U+0000 |