diff options
author | flywind <xzsflywind@gmail.com> | 2022-01-28 16:53:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 09:53:42 +0100 |
commit | 0c3892c3c707e75520d6c8b5a65a0eaf8c15fcd4 (patch) | |
tree | 04991a6409535c3fad37498a690df356b6d739c6 /tests/objects | |
parent | 6319b00ef7f93fa8d7d44c981f850262d8e0ed6a (diff) | |
download | Nim-0c3892c3c707e75520d6c8b5a65a0eaf8c15fcd4.tar.gz |
nvro don't touch cdecl types [backport: 1.6] (#19461)
* nvro don't touch cdecl types; fix #19342 again
Diffstat (limited to 'tests/objects')
-rw-r--r-- | tests/objects/t19342_2.nim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/objects/t19342_2.nim b/tests/objects/t19342_2.nim new file mode 100644 index 000000000..6f6d0f2b3 --- /dev/null +++ b/tests/objects/t19342_2.nim @@ -0,0 +1,18 @@ +discard """ + targets: "c cpp" +""" + +{.compile: "m19342.c".} + +# bug #19342 +type + Node* {.byRef.} = object + data: array[25, cint] + +proc myproc(name: cint): Node {.importc: "hello", cdecl.} + +proc parse = + let node = myproc(10) + doAssert node.data[0] == 999 + +parse() \ No newline at end of file |