summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/arrows/should_run/T3822.hs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-06-19 16:00:49 +0000
committerIan Lynagh <igloo@earth.li>2010-06-19 16:00:49 +0000
commit6fd4c3b78d50b6ca5da0c9685fd50a28e3524ae8 (patch)
treec5042d08ade22f6550f705806de55732d2e46ace /testsuite/tests/ghc-regress/arrows/should_run/T3822.hs
parent504e4c0f924c8de37c6c7b34fb7b5567732bb26f (diff)
downloadhaskell-6fd4c3b78d50b6ca5da0c9685fd50a28e3524ae8.tar.gz
Add a test for #3822
Diffstat (limited to 'testsuite/tests/ghc-regress/arrows/should_run/T3822.hs')
-rw-r--r--testsuite/tests/ghc-regress/arrows/should_run/T3822.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/arrows/should_run/T3822.hs b/testsuite/tests/ghc-regress/arrows/should_run/T3822.hs
new file mode 100644
index 0000000000..93e6dc5797
--- /dev/null
+++ b/testsuite/tests/ghc-regress/arrows/should_run/T3822.hs
@@ -0,0 +1,17 @@
+
+{-# LANGUAGE Arrows #-}
+
+import Control.Arrow
+import qualified Control.Category as Cat
+
+test :: Int -> Int
+test = proc x -> do
+ let neg = x < 0
+ case x of
+ x | neg -> returnA -< 0 -- GHC panics
+ --x | x < 0 -> returnA -< 0 -- GHC doesn't panic
+ _ -> returnA -< 10
+
+main = do
+ print $ test (-1)
+ print $ test 1