[project @ 2000-04-21 15:07:45 by simonpj]
authorsimonpj <unknown>
Fri, 21 Apr 2000 15:07:45 +0000 (15:07 +0000)
committersimonpj <unknown>
Fri, 21 Apr 2000 15:07:45 +0000 (15:07 +0000)
Add loop test

ghc/tests/simplCore/should_compile/Simpl006Help.hs [new file with mode: 0644]
ghc/tests/simplCore/should_compile/simpl006.hs [new file with mode: 0644]

diff --git a/ghc/tests/simplCore/should_compile/Simpl006Help.hs b/ghc/tests/simplCore/should_compile/Simpl006Help.hs
new file mode 100644 (file)
index 0000000..4356a28
--- /dev/null
@@ -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 (file)
index 0000000..81e43a5
--- /dev/null
@@ -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)
+
+