diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/macros/tmemit.nim | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/macros/tmemit.nim b/tests/macros/tmemit.nim index 6fb2f3b65..e5aed3172 100644 --- a/tests/macros/tmemit.nim +++ b/tests/macros/tmemit.nim @@ -1,7 +1,21 @@ discard """ - output: '''HELLO WORLD''' + output: '''HELLO WORLD +c_func''' """ import macros, strutils emit("echo " & '"' & "hello world".toUpper & '"') + +# bug #1025 + +macro foo(icname): stmt = + let ic = newStrLitNode($icname) + result = quote do: + proc x* = + proc private {.exportc: `ic`.} = discard + echo `ic` + private() + +foo(c_func) +x() |