Commit 48b4b88d authored by Edward Z. Yang's avatar Edward Z. Yang

Failing (by timeout) tests for #367.

Signed-off-by: Edward Z. Yang's avatarEdward Z. Yang <ezyang@mit.edu>
parent faec924a
{-# LANGUAGE MagicHash #-}
import Control.Concurrent
import qualified Data.Vector as U
main = do
t <- forkIO (U.sum (U.enumFromTo 1 (1000000000 :: Int)) `seq` return ())
threadDelay 10
killThread t
putStrLn "Done"
{-# LANGUAGE MagicHash #-}
-- Should be compiled with -O0
import Control.Concurrent
import GHC.Conc
import GHC.Prim
import GHC.Exts
main = do
t <- forkIO (f 0 `seq` return ())
threadDelay 10
killThread t
putStrLn "Done"
-- Non-allocating let-no-escape infinite loop in fail
{-# NOINLINE f #-}
f :: Int -> Bool
f i@(I# j) = let fail :: Int# -> Bool
fail i = fail (i +# 1#)
in if (case i of
0 -> True
_ -> False) then fail j else False
......@@ -21,6 +21,10 @@ test('conc071', omit_ways(['threaded2']), compile_and_run, [''])
test('conc072', only_ways(['threaded2']), compile_and_run, [''])
test('conc073', normal, compile_and_run, [''])
# vector code must get inlined to become non-allocating
test('367', composes([skip_if_fast, expect_fail]), compile_and_run, ['-O2'])
test('367_letnoescape', composes([skip_if_fast, expect_fail]), compile_and_run, [''])
test('1980', normal, compile_and_run, [''])
test('2910', normal, compile_and_run, [''])
test('2910a', normal, compile_and_run, [''])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment