summary refs log tree commit diff stats
path: root/tests/vm
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-11-06 22:25:55 +0800
committerGitHub <noreply@github.com>2022-11-06 22:25:55 +0800
commita228e331f30def00d4369d4e792c7454963d8c4e (patch)
treec71f290614fb8c65c64a17d6780b1cd85ccc412a /tests/vm
parentfc8bfd781a68d3d3efdf713fa2c92c440c7783a2 (diff)
downloadNim-a228e331f30def00d4369d4e792c7454963d8c4e.tar.gz
fixes regression #17121; adding doc comment in importc proc makes it silently noop at CT (#20766)
* fixes regression #17121; adding doc comment in importc proc makes it silently noop at CT

* Update compiler/vmgen.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'tests/vm')
-rw-r--r--tests/vm/t17121.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/vm/t17121.nim b/tests/vm/t17121.nim
new file mode 100644
index 000000000..bf2d6423f
--- /dev/null
+++ b/tests/vm/t17121.nim
@@ -0,0 +1,9 @@
+discard """
+  errormsg: "cannot 'importc' variable at compile time; c_printf"
+"""
+
+proc c_printf*(frmt: cstring): cint {.importc: "printf", header: "<stdio.h>", varargs, discardable.} =
+  ## foo bar
+  runnableExamples: discard
+static:
+  let a = c_printf("abc\n")