summaryrefslogtreecommitdiff
path: root/testsuite/tests/asmgen/catch-rec.cmm
blob: 51089d3250989e96db9bb65bcbddfb9811e9dbcf (plain)
1
2
3
4
5
6
7
8
9
10
11
(* TEST
readonly_files = "main.c"
arguments = "-DINT_INT -DFUN=catch_fact main.c"
* asmgen
*)

(function "catch_fact" (b:int)
  (catch (exit fact b 1)
   with (fact c:val acc:val)
     (if (== c 0) acc
         (exit fact (- c 1) ( * c acc)))))