temit.nim 239 B

1234567891011121314151617
  1. discard """
  2. output: "509"
  3. """
  4. # Test the new ``emit`` pragma:
  5. {.emit: """
  6. #include <stdio.h>
  7. static int cvariable = 420;
  8. """.}
  9. proc embedsC() =
  10. var nimVar = 89
  11. {.emit: """printf("%d\n", cvariable + (int)`nimVar`);""".}
  12. embedsC()