summary refs log tree commit diff stats
path: root/tests/vm
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-02-01 02:22:10 +0800
committerGitHub <noreply@github.com>2023-01-31 19:22:10 +0100
commitb5f64f55d02a8ba980244596dcf310dd76b48fd8 (patch)
treeb1cecd05599e60e2b3ae635201cfe218c84a723a /tests/vm
parentebaa07b955182dd98a1bfe06de4195fe1d306c5e (diff)
downloadNim-b5f64f55d02a8ba980244596dcf310dd76b48fd8.tar.gz
fixes #16790; fixes #19075; put big arrays on the constant seqs; don't inline them in the VM; big performance boost (#21318)
* don't inline arrays in VM

* add a test for #19075
Diffstat (limited to 'tests/vm')
-rw-r--r--tests/vm/t19075.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/vm/t19075.nim b/tests/vm/t19075.nim
new file mode 100644
index 000000000..89ca9cb19
--- /dev/null
+++ b/tests/vm/t19075.nim
@@ -0,0 +1,19 @@
+discard """
+  timeout: 10
+  joinable: false
+"""
+
+# bug #19075
+const size = 50_000
+
+const stuff = block:
+    var a: array[size, int]
+    a
+
+const zeugs = block:
+    var zeugs: array[size, int]
+    for i in 0..<size:
+        zeugs[i] = stuff[i]
+    zeugs
+
+doAssert zeugs[0] == 0
\ No newline at end of file