Files
Nim/tests/arc/tcstring.nim
Ico Doornekamp bfe96e069b Fixed codegen for constant cstring with --gc:arc (#13326)
* Fixed codegen for constant cstring with --gc:arc, fixes  #13321

* Added test for #13321
2020-02-04 17:39:27 +01:00

17 lines
242 B
Nim

discard """
cmd: "nim c --gc:arc -r $file"
nimout: '''hello
h
o
'''
"""
# Issue #13321: [codegen] --gc:arc does not properly emit cstring, results in SIGSEGV
let a = "hello".cstring
echo a
echo a[0]
echo a[4]
doAssert a[a.len] == '\0'