blob: 1142f5fabd5ab81c2fd16c3e0d7b75710ec948bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
-- Test #6146 (a bug in -feager-blackholing) I couldn't reliably
-- reproduce it, but this program occasionally triggers it so it's
-- better than nothing.
module Main (main) where
import System.IO
import Control.Concurrent
import System.Mem
main :: IO ()
main = do
putStrLn "First number? "
num1 <- readLn :: IO Int
performGC -- provokes bug (sometimes)
putStrLn "Second number? "
num2 <- readLn :: IO Int
let total = num1 + num2
putStrLn $ "The sum is " ++ (show total) ++ "."
|