From 677d7900d7f09ca8358275bfa5ee9c7765c55d4b Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 21 Apr 2000 15:07:45 +0000 Subject: [PATCH] [project @ 2000-04-21 15:07:45 by simonpj] Add loop test --- ghc/tests/simplCore/should_compile/Simpl006Help.hs | 5 +++++ ghc/tests/simplCore/should_compile/simpl006.hs | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ghc/tests/simplCore/should_compile/Simpl006Help.hs create mode 100644 ghc/tests/simplCore/should_compile/simpl006.hs diff --git a/ghc/tests/simplCore/should_compile/Simpl006Help.hs b/ghc/tests/simplCore/should_compile/Simpl006Help.hs new file mode 100644 index 0000000..4356a28 --- /dev/null +++ b/ghc/tests/simplCore/should_compile/Simpl006Help.hs @@ -0,0 +1,5 @@ +{-# OPTIONS -O #-} + +module Simpl006Help( forever ) where + +forever c = sequence_ (repeat c) diff --git a/ghc/tests/simplCore/should_compile/simpl006.hs b/ghc/tests/simplCore/should_compile/simpl006.hs new file mode 100644 index 0000000..81e43a5 --- /dev/null +++ b/ghc/tests/simplCore/should_compile/simpl006.hs @@ -0,0 +1,19 @@ +-- !!! This one sent 4.06 into an infinite loop + +-- But it worked ok if Simpl006Help.forever is +-- defined in this module. I have no idea why! + +{-# OPTIONS -O #-} + +module ShouldCompile where + +import Concurrent +import Simpl006Help + +after :: Int -> IO a -> IO a +after d c = c + +every :: Int -> IO a -> IO () +every d c = forever (after d c) + + -- 1.7.10.4