[commit: ghc] wip/T13861: check that 'quux' is the identity (86511f3)
git at git.haskell.org
git at git.haskell.org
Fri Dec 29 12:28:00 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T13861
Link : http://ghc.haskell.org/trac/ghc/changeset/86511f33de49acabb2ffc2e08932db9f74d35312/ghc
>---------------------------------------------------------------
commit 86511f33de49acabb2ffc2e08932db9f74d35312
Author: Gabor Greif <ggreif at gmail.com>
Date: Fri Dec 29 07:52:57 2017 +0100
check that 'quux' is the identity
>---------------------------------------------------------------
86511f33de49acabb2ffc2e08932db9f74d35312
testsuite/tests/simplStg/should_run/T13861.hs | 10 ++++++++++
testsuite/tests/simplStg/should_run/T13861.stdout | 1 +
2 files changed, 11 insertions(+)
diff --git a/testsuite/tests/simplStg/should_run/T13861.hs b/testsuite/tests/simplStg/should_run/T13861.hs
index fed0e7a..d09b973 100644
--- a/testsuite/tests/simplStg/should_run/T13861.hs
+++ b/testsuite/tests/simplStg/should_run/T13861.hs
@@ -26,6 +26,14 @@ baz _ = Nothing
{-# NOINLINE baz #-}
+data Boo = Tru | Fal
+
+quux True = Fal
+quux False = Tru
+{-# NOINLINE quux #-}
+
+
+
nested :: Either Int (Either Int a) -> Either Bool (Maybe a)
nested (Right (Right x)) = Right (Just x)
nested _ = Left True
@@ -79,6 +87,8 @@ test x = do
(same $! r46) $! r47 -- no, GADT
let (r48, r49) = (Refl, eq2 r48)
(same $! r48) $! r49 -- no, GADT
+ let (r50, r51) = (True, quux r50)
+ (same $! r50) $! r51 -- yes, quux is identity
let (r4,_) = bar r1
let r5 = nested r4
diff --git a/testsuite/tests/simplStg/should_run/T13861.stdout b/testsuite/tests/simplStg/should_run/T13861.stdout
index d1124c6..0a6ddab 100644
--- a/testsuite/tests/simplStg/should_run/T13861.stdout
+++ b/testsuite/tests/simplStg/should_run/T13861.stdout
@@ -8,5 +8,6 @@ no
no
yes
yes
+yes
no
("YAY","foo")
More information about the ghc-commits
mailing list