summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-11-07 21:36:43 +0800
committerGitHub <noreply@github.com>2022-11-07 14:36:43 +0100
commit600b3a91abbe7dede5abd9744e02fc48089ee34d (patch)
tree6c16bd3a18a700631f48626aa9fd1adc37f0ddb5 /tests
parent66b0c843c34dba2a8f28e1c02ff996516a3c5c2a (diff)
downloadNim-600b3a91abbe7dede5abd9744e02fc48089ee34d.tar.gz
fixes regression #20746; remove string copies for ORC booted compiler (#20776)
* fixes #20746; remove string copies for ORC booted compiler

* add a test case

* use `cursor` thanks to @beef331

* for old compilers

* change file extension

* change test cases
Diffstat (limited to 'tests')
-rw-r--r--tests/vm/t20746.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/vm/t20746.nim b/tests/vm/t20746.nim
new file mode 100644
index 000000000..bfad269ef
--- /dev/null
+++ b/tests/vm/t20746.nim
@@ -0,0 +1,13 @@
+discard """
+  timeout: 10
+  joinable: false
+  output: "fine"
+"""
+
+func addString(): string =
+  let x = newString(1000000)
+  for i in 0..<1000000:
+    discard x[i]
+
+const translationTable = addString()
+echo "fine"