Files
Nim/tests/misc/temit.nim
Adam Strzelecki e80465dacf tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:04:32 +02:00

21 lines
244 B
Nim

discard """
file: "temit.nim"
output: "509"
"""
# Test the new ``emit`` pragma:
{.emit: """
static int cvariable = 420;
""".}
proc embedsC() =
var nimVar = 89
{.emit: """printf("%d\n", cvariable + (int)`nimVar`);""".}
embedsC()