fixes nim check with orc (#20456)
* fixes nim check with orc * fixes tests * add tests * fixes tests * Update tests/arc/t20456.nim
This commit is contained in:
parent
0769b160c5
commit
81e7811e01
5 changed files with 27 additions and 1 deletions
|
|
@ -97,6 +97,10 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
|
||||||
if not self.loadConfigsAndProcessCmdLine(cache, conf, graph):
|
if not self.loadConfigsAndProcessCmdLine(cache, conf, graph):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if conf.cmd == cmdCheck and optWasNimscript notin conf.globalOptions and
|
||||||
|
conf.backend == backendInvalid:
|
||||||
|
conf.backend = backendC
|
||||||
|
|
||||||
if conf.selectedGC == gcUnselected:
|
if conf.selectedGC == gcUnselected:
|
||||||
if conf.backend in {backendC, backendCpp, backendObjc}:
|
if conf.backend in {backendC, backendCpp, backendObjc}:
|
||||||
initOrcDefines(conf)
|
initOrcDefines(conf)
|
||||||
|
|
|
||||||
7
tests/arc/t20456.nim
Normal file
7
tests/arc/t20456.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
discard """
|
||||||
|
cmd: "nim check $file"
|
||||||
|
action: "compile"
|
||||||
|
"""
|
||||||
|
|
||||||
|
when not defined(gcOrc):
|
||||||
|
{.error: "orc".}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
discard """
|
discard """
|
||||||
cmd: "nim check --showAllMismatches:on --hints:off $file"
|
cmd: "nim check --mm:refc --showAllMismatches:on --hints:off $file"
|
||||||
nimout: '''
|
nimout: '''
|
||||||
tsigmatch.nim(111, 4) Error: type mismatch: got <A, string>
|
tsigmatch.nim(111, 4) Error: type mismatch: got <A, string>
|
||||||
but expected one of:
|
but expected one of:
|
||||||
|
|
|
||||||
1
tests/misc/m20456.nims
Normal file
1
tests/misc/m20456.nims
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
echo 123
|
||||||
14
tests/misc/t20456_2.nim
Normal file
14
tests/misc/t20456_2.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
discard """
|
||||||
|
joinable: false
|
||||||
|
"""
|
||||||
|
|
||||||
|
import std/[osproc, os, strformat]
|
||||||
|
from stdtest/specialpaths import testsDir
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
const
|
||||||
|
nim = getCurrentCompilerExe()
|
||||||
|
file = testsDir / "misc" / "m20456.nims"
|
||||||
|
doAssert execCmd(fmt"{nim} check {file}") == 0
|
||||||
Loading…
Add table
Add a link
Reference in a new issue