summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-11-03 18:41:41 +0800
committerGitHub <noreply@github.com>2020-11-03 11:41:41 +0100
commitb8bcf236dd29ee2a6ec7587dc3f028f14023ebec (patch)
tree65e96f2ec13ac371229464a869e1863f0f22b442 /tests
parentfde17b159fdc96eda5609fd98e1fe3c7a34ef40b (diff)
downloadNim-b8bcf236dd29ee2a6ec7587dc3f028f14023ebec.tar.gz
fix #12640 (#15829)
Diffstat (limited to 'tests')
-rw-r--r--tests/pragmas/t12640.nim25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/pragmas/t12640.nim b/tests/pragmas/t12640.nim
new file mode 100644
index 000000000..60177d034
--- /dev/null
+++ b/tests/pragmas/t12640.nim
@@ -0,0 +1,25 @@
+discard """
+  nimout: '''1
+2
+3
+[1, 2, 3]'''
+
+  output: '''1
+2
+3
+[1, 2, 3]'''
+"""
+
+
+proc doIt(a: openArray[int]) =
+  echo a
+
+proc foo() = 
+  var bug {.global, compiletime.}: seq[int]
+  bug = @[1, 2 ,3]
+  for i in 0 .. high(bug): echo bug[i]
+  doIt(bug)
+
+static:
+  foo()
+foo()