t19457.nim 252 B

12345678910111213141516
  1. discard """
  2. matrix: "--gc:refc; --gc:arc"
  3. """
  4. # bug #19457
  5. proc gcd(x, y: seq[int]): seq[int] =
  6. var
  7. a = x
  8. b = y
  9. while b[0] > 0:
  10. let c = @[a[0] mod b[0]]
  11. a = b
  12. b = c
  13. return a
  14. doAssert gcd(@[1], @[2]) == @[1]