tcstring.nim 242 B

1234567891011121314151617
  1. discard """
  2. cmd: "nim c --gc:arc -r $file"
  3. nimout: '''hello
  4. h
  5. o
  6. '''
  7. """
  8. # Issue #13321: [codegen] --gc:arc does not properly emit cstring, results in SIGSEGV
  9. let a = "hello".cstring
  10. echo a
  11. echo a[0]
  12. echo a[4]
  13. doAssert a[a.len] == '\0'