summary refs log blame commit diff stats
path: root/tests/arc/t19457.nim
blob: 78447ce82a51dedcf7773aabcb57db3bd648b4cb (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                    
discard """
  matrix: "--gc:refc; --gc:arc"
"""

# bug #19457
proc gcd(x, y: seq[int]): seq[int] =
    var
      a = x
      b = y
    while b[0] > 0:
      let c = @[a[0] mod b[0]]
      a = b
      b = c
    return a

doAssert gcd(@[1], @[2]) == @[1]