diff options
Diffstat (limited to 'tests/accept/run/temit.nim')
-rw-r--r-- | tests/accept/run/temit.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/accept/run/temit.nim b/tests/accept/run/temit.nim new file mode 100644 index 000000000..81f9b53ae --- /dev/null +++ b/tests/accept/run/temit.nim @@ -0,0 +1,14 @@ +# Test the new ``emit`` pragma: + +{.emit: """ +static int cvariable = 420; + +""".} + +proc embedsC() {.pure.} = + var nimrodVar = 89 + {.emit: """fprintf(stdout, "%d\n", cvariable + (int)`nimrodVar`);""".} + +embedsC() + + |