From e008630838f545a04334ee71a5d6c52469fed056 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 7 Jan 2011 00:17:18 +0100 Subject: implemented 'emit' pragma --- tests/accept/run/temit.nim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/accept/run/temit.nim (limited to 'tests/accept/run/temit.nim') 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() + + -- cgit 1.4.1-2-gfad0