summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_run/T3972.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/simplCore/should_run/T3972.hs')
-rw-r--r--testsuite/tests/simplCore/should_run/T3972.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_run/T3972.hs b/testsuite/tests/simplCore/should_run/T3972.hs
new file mode 100644
index 0000000000..324ddd4f9a
--- /dev/null
+++ b/testsuite/tests/simplCore/should_run/T3972.hs
@@ -0,0 +1,25 @@
+
+module Main (main) where
+
+import T3972A (Expr(E10), Token, spanning, getSpan)
+
+import Control.Monad
+import System.Exit
+import System.IO
+
+main :: IO ()
+main = do h <- openFile "T3972.o" ReadMode
+ s <- hFileSize h
+ hClose h
+ -- size is just under 8k on amd64/Linux in 6.13, but was
+ -- around 3.5M in 6.12. Let's try >20k as the test for
+ -- having regressed.
+ when (s > 20000) $ do
+ hPutStrLn stderr ("T3972.o is too big! " ++ show s)
+ exitFailure
+
+makeTupleOrExpr :: [Expr] -> Maybe Token -> Expr
+makeTupleOrExpr [e] Nothing = e
+makeTupleOrExpr es@(_:_) (Just t) = E10 (spanning es t)
+makeTupleOrExpr es@(_:_) Nothing = E10 (getSpan es)
+