summary refs log tree commit diff stats
path: root/tests/run/temit.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/temit.nim')
-rwxr-xr-xtests/run/temit.nim20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/run/temit.nim b/tests/run/temit.nim
new file mode 100755
index 000000000..460bc3443
--- /dev/null
+++ b/tests/run/temit.nim
@@ -0,0 +1,20 @@
+discard """
+  file: "temit.nim"
+  output: "509"
+"""
+# Test the new ``emit`` pragma: 
+
+{.emit: """
+static int cvariable = 420;
+
+""".}
+
+proc embedsC() {.noStackFrame.} = 
+  var nimrodVar = 89
+  {.emit: """fprintf(stdout, "%d\n", cvariable + (int)`nimrodVar`);""".}
+
+embedsC()
+
+
+
+