fix some codegen bugs: NIM_BOOL, NIM_STATIC_ASSERT, --passc:-std=... (etc) (#13798)

* fix cgen bool D20200328T203812
* --passc:std=c++17 (etc) now works instead of silently ignored
* document caveats for NIM_NIL
This commit is contained in:
Timothee Cour 2020-04-07 06:17:30 -07:00 • committed by GitHub
commit ab5e26c53c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 110 additions and 54 deletions

View file

@ -1,28 +0,0 @@
discard """
joinable: false
"""
import std/[strformat,os,osproc]
proc main() =
const nim = getCurrentCompilerExe()
const file = currentSourcePath().parentDir / "mevalffi.nim"
# strangely, --hint:cc:off was needed
let cmd = fmt"{nim} c -f --experimental:compiletimeFFI --hints:off --hint:cc:off {file}"
let (output, exitCode) = execCmdEx(cmd)
let expected = """
hello world stderr
hi stderr
foo
foo:100
foo:101
foo:102:103
foo:102:103:104
foo:0.03:asdf:103:105
ret={s1:foobar s2:foobar age:25 pi:3.14}
"""
doAssert output == expected, output
doAssert exitCode == 0
when defined(nimHasLibFFIEnabled):
main()