summary refs log tree commit diff stats
path: root/tests/objects
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2022-01-28 16:53:42 +0800
committerGitHub <noreply@github.com>2022-01-28 09:53:42 +0100
commit0c3892c3c707e75520d6c8b5a65a0eaf8c15fcd4 (patch)
tree04991a6409535c3fad37498a690df356b6d739c6 /tests/objects
parent6319b00ef7f93fa8d7d44c981f850262d8e0ed6a (diff)
downloadNim-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.nim18
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