From 7f3a9de1ad6132bb6ff9a6121b833a2d17c49fbb Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Tue, 24 Apr 2012 09:19:55 +0100 Subject: [PATCH] Test Trac #5920 --- testsuite/tests/simplCore/should_run/T5920.hs | 10 ++++++++++ testsuite/tests/simplCore/should_run/T5920.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 1 + 3 files changed, 12 insertions(+) create mode 100644 testsuite/tests/simplCore/should_run/T5920.hs create mode 100644 testsuite/tests/simplCore/should_run/T5920.stdout diff --git a/testsuite/tests/simplCore/should_run/T5920.hs b/testsuite/tests/simplCore/should_run/T5920.hs new file mode 100644 index 0000000000..64e4c3b568 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T5920.hs @@ -0,0 +1,10 @@ +module Main where + +-- Stack overflow if the tail recursion does not work + +goInt :: Integer -> Integer -> Int +goInt 500 100000 = 0 +goInt x 100000 = goInt (x+1) 1 +goInt x y = goInt x (y+1) + +main = print $ goInt 1 1 diff --git a/testsuite/tests/simplCore/should_run/T5920.stdout b/testsuite/tests/simplCore/should_run/T5920.stdout new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T5920.stdout @@ -0,0 +1 @@ +0 diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index aa3cc7f236..20b25787a0 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -54,3 +54,4 @@ test('T5603', normal, compile_and_run, ['']) test('T5625', [ only_ways(['normal','optasm']), exit_code(1) ], compile_and_run, ['']) test('T5587', [ only_ways(['normal','optasm']), exit_code(1) ], compile_and_run, ['']) test('T5915', only_ways(['normal','optasm']), compile_and_run, ['']) +test('T5920', only_ways(['normal','optasm']), compile_and_run, ['']) -- GitLab