diff options
author | Araq <rumpf_a@web.de> | 2011-01-07 00:17:18 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-01-07 00:17:18 +0100 |
commit | e008630838f545a04334ee71a5d6c52469fed056 (patch) | |
tree | 32fd06e7c0a4eb519d313c9535f0c61be0239378 /tests/accept/run/temit.nim | |
parent | 1e25aa365b3eef6b8a52ca115a4f27e37432577a (diff) | |
download | Nim-e008630838f545a04334ee71a5d6c52469fed056.tar.gz |
implemented 'emit' pragma
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() + + |