Move tests from tests/ghc-regress/* to just tests/*
[ghc.git] / testsuite / tests / simplCore / should_run / T3972.hs
1
2 module Main (main) where
3
4 import T3972A (Expr(E10), Token, spanning, getSpan)
5
6 import Control.Monad
7 import System.Exit
8 import System.IO
9
10 main :: IO ()
11 main = do h <- openFile "T3972.o" ReadMode
12 s <- hFileSize h
13 hClose h
14 -- size is just under 8k on amd64/Linux in 6.13, but was
15 -- around 3.5M in 6.12. Let's try >20k as the test for
16 -- having regressed.
17 when (s > 20000) $ do
18 hPutStrLn stderr ("T3972.o is too big! " ++ show s)
19 exitFailure
20
21 makeTupleOrExpr :: [Expr] -> Maybe Token -> Expr
22 makeTupleOrExpr [e] Nothing = e
23 makeTupleOrExpr es@(_:_) (Just t) = E10 (spanning es t)
24 makeTupleOrExpr es@(_:_) Nothing = E10 (getSpan es)
25