summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/concurrent/should_run/1980.hs
blob: 61fcd9d15b50e3bf2482225689dbdab08180e52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import Control.Exception
import Control.Concurrent

main = do
  thr <- myThreadId
  evaluate $ increase_stack 1000
  throwTo thr ThreadKilled
        `Control.Exception.catch` (\e -> case e of
                         ThreadKilled -> return ()
                         _ -> throw e)
 where
  increase_stack 0 = 1
  increase_stack n = increase_stack (n-1) + n