summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-09-18 12:45:32 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-09-18 12:45:32 +0000
commit18781c8a8048ac81f70f78da9e6fcf0fe5a2a9b2 (patch)
tree035ef5f2d675a3c5e6598768e42e1fd3a4f98ec6 /testsuite
parent9e75b25e3611b1cf59459d1b5915b172624c25d3 (diff)
downloadhaskell-18781c8a8048ac81f70f78da9e6fcf0fe5a2a9b2.tar.gz
add test for #2881
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/ghc-regress/ghci/should_run/2881.hs8
-rw-r--r--testsuite/tests/ghc-regress/ghci/should_run/2881.stdout1
-rw-r--r--testsuite/tests/ghc-regress/ghci/should_run/all.T1
3 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/ghci/should_run/2881.hs b/testsuite/tests/ghc-regress/ghci/should_run/2881.hs
new file mode 100644
index 0000000000..94ecfa6a00
--- /dev/null
+++ b/testsuite/tests/ghc-regress/ghci/should_run/2881.hs
@@ -0,0 +1,8 @@
+import Data.Word
+fib :: Word -> Word
+fib 0 = 1
+fib 1 = 1
+fib n = l + r
+ where l = fib (n-2); r = fib (n-1)
+
+main = print (fib 20)
diff --git a/testsuite/tests/ghc-regress/ghci/should_run/2881.stdout b/testsuite/tests/ghc-regress/ghci/should_run/2881.stdout
new file mode 100644
index 0000000000..06a735b308
--- /dev/null
+++ b/testsuite/tests/ghc-regress/ghci/should_run/2881.stdout
@@ -0,0 +1 @@
+10946
diff --git a/testsuite/tests/ghc-regress/ghci/should_run/all.T b/testsuite/tests/ghc-regress/ghci/should_run/all.T
index 19caf05254..a3af5b9cd8 100644
--- a/testsuite/tests/ghc-regress/ghci/should_run/all.T
+++ b/testsuite/tests/ghc-regress/ghci/should_run/all.T
@@ -6,6 +6,7 @@ test('ghci001', just_ghci, compile_and_run, [''])
test('ghci002', just_ghci, compile_and_run, [''])
test('ghci003', just_ghci, compile_and_run, [''])
test('2589', just_ghci, compile_and_run, [''])
+test('2881', just_ghci, compile_and_run, [''])
test('3171', if_platform('i386-unknown-mingw32',skip), run_command,
['$MAKE -s --no-print-directory 3171'])