From a228e331f30def00d4369d4e792c7454963d8c4e Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Sun, 6 Nov 2022 22:25:55 +0800 Subject: 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 --- tests/vm/t17121.nim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/vm/t17121.nim (limited to 'tests/vm') 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: "", varargs, discardable.} = + ## foo bar + runnableExamples: discard +static: + let a = c_printf("abc\n") -- cgit 1.4.1-2-gfad0