2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-12 05:06:36 +08:00
artiq/lit-test/compiler/inferencer/gcd.py
2015-07-21 23:39:22 +03:00

14 lines
313 B
Python

# RUN: %python -m artiq.compiler.testbench.inferencer %s >%t
def _gcd(a, b):
if a < 0:
a = -a
while a > 0:
c = a
a = b % a
b = c
return b
# CHECK-L: _gcd:(a:int(width='a), b:int(width='a))->int(width='a)(10:int(width='a), 25:int(width='a)):int(width='a)
_gcd(10, 25)