summaryrefslogtreecommitdiff
path: root/testsuite/tests/asmgen/fib.cmm
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/asmgen/fib.cmm')
-rw-r--r--testsuite/tests/asmgen/fib.cmm20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/asmgen/fib.cmm b/testsuite/tests/asmgen/fib.cmm
new file mode 100644
index 0000000000..49de4ba12e
--- /dev/null
+++ b/testsuite/tests/asmgen/fib.cmm
@@ -0,0 +1,20 @@
+(**************************************************************************)
+(* *)
+(* OCaml *)
+(* *)
+(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
+(* *)
+(* Copyright 1996 Institut National de Recherche en Informatique et *)
+(* en Automatique. *)
+(* *)
+(* All rights reserved. This file is distributed under the terms of *)
+(* the GNU Lesser General Public License version 2.1, with the *)
+(* special exception on linking described in the file LICENSE. *)
+(* *)
+(**************************************************************************)
+
+(function "fib" (n: int)
+ (if (< n 2)
+ 1
+ (+ (app "fib" (- n 1) int)
+ (app "fib" (- n 2) int))))