summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ccgbugs/tassign_nil_strings.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ccgbugs/tassign_nil_strings.nim b/tests/ccgbugs/tassign_nil_strings.nim
new file mode 100644
index 000000000..07d2c2aeb
--- /dev/null
+++ b/tests/ccgbugs/tassign_nil_strings.nim
@@ -0,0 +1,13 @@
+discard """
+  cmd: "nim $target --nilseqs:off $options $file"
+  output: "Hello"
+  ccodecheck: "\\i@'a = ((NimStringDesc*) NIM_NIL)'"
+"""
+
+proc main() =
+  var a = "Hello"
+  echo a
+  a = ""
+  doAssert a.len == 0
+
+main()