summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-03-21 21:05:59 +0100
committerAraq <rumpf_a@web.de>2015-03-22 01:38:13 +0100
commita32237a0117321636b062ae5b1e0d96ff1f95979 (patch)
treef98415778b4ccaf7fe5dd112739b5499a2241daa
parente81c8314b3b947fd46ac8c1d8832f5e2bd3b8422 (diff)
downloadNim-a32237a0117321636b062ae5b1e0d96ff1f95979.tar.gz
fixes #1802
-rw-r--r--tests/parser/tproctype_pragmas.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/parser/tproctype_pragmas.nim b/tests/parser/tproctype_pragmas.nim
new file mode 100644
index 000000000..8c7acd0cf
--- /dev/null
+++ b/tests/parser/tproctype_pragmas.nim
@@ -0,0 +1,19 @@
+discard """
+  output: '''39
+40'''
+"""
+
+# bug 1802
+# Ensure proc pragmas are attached properly:
+
+proc makeStdcall(s: string): (proc(i: int) {.stdcall.}) =
+  (proc (x: int) {.stdcall.} = echo x)
+
+proc makeNimcall(s: string): (proc(i: int)) {.stdcall.} =
+  (proc (x: int) {.nimcall.} = echo x)
+
+let stdc: proc (y: int) {.stdcall.} = makeStdcall("bu")
+let nimc: proc (y: int) {.closure.} = makeNimcall("ba")
+
+stdc(39)
+nimc(40)