summaryrefslogtreecommitdiff
path: root/testsuite/tests/asmgen/pgcd.cmm
blob: cd91e79880d64dd670fdee31eb003806765ab736 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(* TEST
files = "main.c"
arguments = "-ccopt -DINT_INT -ccopt -DFUN=pgcd_30030 main.c"
* asmgen
*)

(function "pgcd_30030" (a:int)
  (catch (exit pgcd a 30030)
   with (pgcd n:val m:val)
     (if (> n m)
         (exit pgcd m n)
         (if (== n 0)
             m
             (let (r (mod m n))
                     (exit pgcd r n))))))