summary refs log tree commit diff stats
path: root/tests/accept/run/temit.nim
blob: cb7d513bd6a4a461feef37ddacdf46b78eba8234 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
discard """
  file: "temit.nim"
  output: "509"
"""
# 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()