summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-11-05 21:00:08 +0800
committerGitHub <noreply@github.com>2020-11-05 14:00:08 +0100
commita8af664e8ba8672e736c72971a18c0e00ba9b086 (patch)
treeaa4a90065f3f423dbbf042b6564958e610f56d47 /tests
parentcae92f670a00ca1a343667dfeb5dfef208086f21 (diff)
downloadNim-a8af664e8ba8672e736c72971a18c0e00ba9b086.tar.gz
fix #15463 (#15831)
Diffstat (limited to 'tests')
-rw-r--r--tests/vm/tswap.nim12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/vm/tswap.nim b/tests/vm/tswap.nim
index 4243b5a71..bdbe5528c 100644
--- a/tests/vm/tswap.nim
+++ b/tests/vm/tswap.nim
@@ -3,7 +3,9 @@ nimout: '''
 x.data = @[10]
 y = @[11]
 x.data = @[11]
-y = @[10]'''
+y = @[10]
+@[3, 2, 1]
+'''
 """
 
 # bug #2946
@@ -22,3 +24,11 @@ proc testSwap(): int {.compiletime.} =
   result = 99
 
 const something = testSwap()
+
+# bug #15463
+block:
+  static:
+    var s = @[1, 2, 3]
+    swap(s[0], s[2])
+
+    echo s