summary refs log tree commit diff stats
path: root/tests/accept
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-01-07 00:17:18 +0100
committerAraq <rumpf_a@web.de>2011-01-07 00:17:18 +0100
commite008630838f545a04334ee71a5d6c52469fed056 (patch)
tree32fd06e7c0a4eb519d313c9535f0c61be0239378 /tests/accept
parent1e25aa365b3eef6b8a52ca115a4f27e37432577a (diff)
downloadNim-e008630838f545a04334ee71a5d6c52469fed056.tar.gz
implemented 'emit' pragma
Diffstat (limited to 'tests/accept')
-rwxr-xr-xtests/accept/run/spec.csv1
-rw-r--r--tests/accept/run/temit.nim14
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/accept/run/spec.csv b/tests/accept/run/spec.csv
index 377c78a58..4bb94ed74 100755
--- a/tests/accept/run/spec.csv
+++ b/tests/accept/run/spec.csv
@@ -19,6 +19,7 @@ tconstr2.nim;69
 tcontinuexc.nim;ECcaught
 tcopy.nim;TEMP=C:\Programs\xyz\bin
 tcurrncy.nim;25
+temit.nim;509
 texcsub.nim;caught!
 texplicitgeneric1.nim;Key: 12 value: 12Key: 13 value: 13 Key: A value: 12 Key: B value: 13
 tfinally.nim;came here 3
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()
+
+