barebone.nim 396 B

1234567891011121314151617
  1. discard """
  2. ccodecheck: "\\i !@('systemInit')"
  3. ccodecheck: "\\i !@('systemDatInit')"
  4. output: "hello"
  5. """
  6. # bug #2041: Macros need to be available for os:standalone!
  7. import macros
  8. proc printf(frmt: cstring) {.varargs, header: "<stdio.h>", cdecl.}
  9. var x = 0
  10. inc x
  11. printf("hi %ld\n", x+4777)
  12. proc substr(a: string): string = a[0 .. 3] # This should compile. See #9762
  13. const a = substr("foobar")