temit.nim 220 B

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