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

               
                               

           
                  



                           
                

                                                            

         
discard """
  output: "509"
"""
# Test the new ``emit`` pragma:

{.emit: """
#include <stdio.h>
static int cvariable = 420;

""".}

proc embedsC() =
  var nimVar = 89
  {.emit: """printf("%d\n", cvariable + (int)`nimVar`);""".}

embedsC()