diff options
Diffstat (limited to 'testsuite/tests/simplCore/should_run')
-rw-r--r-- | testsuite/tests/simplCore/should_run/T23184.hs | 18 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_run/T23184.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_run/all.T | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_run/T23184.hs b/testsuite/tests/simplCore/should_run/T23184.hs new file mode 100644 index 0000000000..ea98bb313f --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T23184.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE BangPatterns #-} +module Main where + +import GHC.Magic + +main :: IO () +main = print $ noinline (\x -> sum $ tardisManual [0..x]) 0 + +tardisManual :: [Int] -> [Int] +tardisManual xs = + let + go [] !acc _ = ([], 0) + go (_:xs) !acc l = + let (xs', _) = go xs acc l + in (l:xs', 0) + (r, l) = go xs True l + in r +{-# INLINE tardisManual #-} diff --git a/testsuite/tests/simplCore/should_run/T23184.stdout b/testsuite/tests/simplCore/should_run/T23184.stdout new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T23184.stdout @@ -0,0 +1 @@ +0 diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index 928bf89df9..fc3d605ac7 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -109,4 +109,5 @@ test('T21575b', [], multimod_compile_and_run, ['T21575b', '-O']) test('T20836', normal, compile_and_run, ['-O0']) # Should not time out; See #20836 test('T22448', normal, compile_and_run, ['-O1']) test('T22998', normal, compile_and_run, ['-O0 -fspecialise -dcore-lint']) +test('T23184', normal, compile_and_run, ['-O']) |