diff --git a/ghc/tests/lib/should_run/Makefile b/ghc/tests/lib/should_run/Makefile index b65b4d9502a01fa6169bc1a648c3287a8ad2ec24..4785fc101c690a9928f76158ee5021c012d8770d 100644 --- a/ghc/tests/lib/should_run/Makefile +++ b/ghc/tests/lib/should_run/Makefile @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# $Id: Makefile,v 1.12 1999/06/09 09:35:58 simonpj Exp $ +# $Id: Makefile,v 1.13 1999/08/04 10:07:50 simonmar Exp $ TOP = ../.. include $(TOP)/mk/boilerplate.mk @@ -29,6 +29,9 @@ memo001_HC_OPTS = -syslib misc # finalized properly, and stable names are GC'd etc. memo001_RUNTEST_OPTS = +RTS -A10k -G1 +memo002_HC_OPTS = -syslib misc +memo002_RUNTEST_OPTS = 20 + SRC_MKDEPENDHS_OPTS += -syslib misc -syslib exts include $(TOP)/mk/target.mk diff --git a/ghc/tests/lib/should_run/memo002.hs b/ghc/tests/lib/should_run/memo002.hs new file mode 100644 index 0000000000000000000000000000000000000000..d441c0a3cdd8d876a2feacd3c44ab8eb32cc2d15 --- /dev/null +++ b/ghc/tests/lib/should_run/memo002.hs @@ -0,0 +1,25 @@ +module Main +where + +import Memo +import System(getArgs) + +main = do (arg:_) <- getArgs + mapM_ printTriple [ (i,fib i,mfib i) | i <- [10..read arg] ] + where printTriple (i,fi,mfi) = do print i + print fi + print mfi + putStrLn "" + +mfib :: Integer -> Integer +mfib = memo ufib + +ufib :: Integer -> Integer +ufib 0 = 1 +ufib 1 = 1 +ufib n = mfib (n-1) + mfib (n-2) + +fib :: Integer -> Integer +fib 0 = 1 +fib 1 = 1 +fib n = fib (n-1) + fib (n-2) diff --git a/ghc/tests/lib/should_run/memo002.stdout b/ghc/tests/lib/should_run/memo002.stdout new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391