Repository : ssh://darcs.haskell.org//srv/darcs/testsuite On branch : ghc-new-co
http://hackage.haskell.org/trac/ghc/changeset/d1f0d1da9bfabd751e8a67aa0564e7335bd29a8d >--------------------------------------------------------------- commit d1f0d1da9bfabd751e8a67aa0564e7335bd29a8d Author: Simon Peyton Jones <[email protected]> Date: Fri May 6 15:54:14 2011 +0100 Test Trac #5168 >--------------------------------------------------------------- .../ghc-regress/simplCore/should_compile/T5168.hs | 32 ++++++++++++++++++++ tests/ghc-regress/simplCore/should_compile/all.T | 5 +++ 2 files changed, 37 insertions(+), 0 deletions(-) diff --git a/tests/ghc-regress/simplCore/should_compile/T5168.hs b/tests/ghc-regress/simplCore/should_compile/T5168.hs new file mode 100644 index 0000000..f34a72d --- /dev/null +++ b/tests/ghc-regress/simplCore/should_compile/T5168.hs @@ -0,0 +1,32 @@ +# In this test we do -ddump-simpl, and grep for 'patError. +# We expect *not* to see patError in the output +# because the branch is inaccessible. +# In GHC 7.0 and earlier, we did get a patError in the output program. + +{-# LANGUAGE TypeFamilies, GADTs #-} +module NoMatch where + +data Tag +data TagExtra + +-------- + +data Foo a where + Foo :: String -> Foo a + FooExtra :: Int -> Foo TagExtra + +-- The cmm code for fooName does not match against 'FooExtra' +fooName :: Foo Tag -> String +fooName (Foo s) = s + +-------- + +data Bar a where + Bar :: String -> Bar a + BarExtra :: a ~ TagExtra => Int -> Bar a + +-- The cmm code for barName will try to pattern-match against 'BarExtra' +barName :: Bar Tag -> String +barName (Bar s) = s + + diff --git a/tests/ghc-regress/simplCore/should_compile/all.T b/tests/ghc-regress/simplCore/should_compile/all.T index 5038471..4df1641 100644 --- a/tests/ghc-regress/simplCore/should_compile/all.T +++ b/tests/ghc-regress/simplCore/should_compile/all.T @@ -116,3 +116,8 @@ test('T4957', normal, run_command, ['$MAKE -s --no-print-directory T4957']) + +test('T5168', + normal, + run_command, + ['$MAKE -s --no-print-directory T5168']) _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
