diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-04-07 06:17:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 15:17:30 +0200 |
commit | ab5e26c53cf34a1839dd92d247b5e0a5cde432a0 (patch) | |
tree | c2a5f46c4ecdcd469bd9c17ef6c5cbb052aaaaaf /tests/ccgbugs | |
parent | b41931bf67136f50cf8fb11442a7e614da00a0b9 (diff) | |
download | Nim-ab5e26c53cf34a1839dd92d247b5e0a5cde432a0.tar.gz |
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
Diffstat (limited to 'tests/ccgbugs')
-rw-r--r-- | tests/ccgbugs/mstatic_assert.nim | 6 | ||||
-rw-r--r-- | tests/ccgbugs/tcodegenbug_bool.nim | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/ccgbugs/mstatic_assert.nim b/tests/ccgbugs/mstatic_assert.nim new file mode 100644 index 000000000..dbf9c03d1 --- /dev/null +++ b/tests/ccgbugs/mstatic_assert.nim @@ -0,0 +1,6 @@ +{.emit:""" +NIM_STATIC_ASSERT(sizeof(bool) == 1, ""); +#warning "foo2" +NIM_STATIC_ASSERT(sizeof(bool) == 2, ""); +#warning "foo3" +""".} diff --git a/tests/ccgbugs/tcodegenbug_bool.nim b/tests/ccgbugs/tcodegenbug_bool.nim new file mode 100644 index 000000000..a0dbf4eb2 --- /dev/null +++ b/tests/ccgbugs/tcodegenbug_bool.nim @@ -0,0 +1,11 @@ +discard """ +""" + +# issue #13798 +{.emit:""" +#include <stdbool.h> +void fun(bool a){} +""".} + +proc fun(a: bool) {.importc.} +fun(true) |