summary refs log blame commit diff stats
path: root/tests/misc/temit.nim
blob: e2a9eaff1e11f080ae7e2e09bf7b5069fc596fa0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                

                                                            





         
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()