summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/simplCore/should_compile/simpl012.hs
diff options
context:
space:
mode:
authorsimonpj <unknown>2005-05-24 11:30:35 +0000
committersimonpj <unknown>2005-05-24 11:30:35 +0000
commit78c253f6c1c01e2e27b9fcda7886a4407d1b2fde (patch)
treea17ec6975895a12c095b35926ca1e60b4f21925a /testsuite/tests/ghc-regress/simplCore/should_compile/simpl012.hs
parent15f347a3d1b4e3545915afc8ba16991227478c1c (diff)
downloadhaskell-78c253f6c1c01e2e27b9fcda7886a4407d1b2fde.tar.gz
[project @ 2005-05-24 11:30:35 by simonpj]
Add simplifier loop test
Diffstat (limited to 'testsuite/tests/ghc-regress/simplCore/should_compile/simpl012.hs')
-rw-r--r--testsuite/tests/ghc-regress/simplCore/should_compile/simpl012.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/simplCore/should_compile/simpl012.hs b/testsuite/tests/ghc-regress/simplCore/should_compile/simpl012.hs
new file mode 100644
index 0000000000..09af3e5618
--- /dev/null
+++ b/testsuite/tests/ghc-regress/simplCore/should_compile/simpl012.hs
@@ -0,0 +1,23 @@
+-- This is a version of tc095.hs, which makes the compiler
+-- loop (with -O) because of the recursive data-type bug,
+-- unless you have the NOINLINE (which Happy does,
+-- as it happens).
+
+-- Keywords: diverge, contravariant, fixpoint
+
+module ShouldSucceed where
+
+happyParse = happyFail 7 7 (error "reading EOF!") (HappyState happyFail) [] [] []
+
+data HappyState b c = HappyState
+ (Int -> -- token number
+ Int -> -- token number (yes, again)
+ b -> -- token semantic value
+ HappyState b c -> -- current state
+ [HappyState b c] -> -- state stack
+ c)
+
+{-# NOINLINE happyFail #-}
+happyFail _ i tk st@(HappyState action) sts stk = action (-1) (-1) tk st sts ( stk)
+
+