[commit: ghc] wip/T13861: make 'quux'' test 3 to 2 (46fcad9)
git at git.haskell.org
git at git.haskell.org
Fri Dec 29 12:28:03 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T13861
Link : http://ghc.haskell.org/trac/ghc/changeset/46fcad9c42535417769db4a410dbb3f5d7505c01/ghc
>---------------------------------------------------------------
commit 46fcad9c42535417769db4a410dbb3f5d7505c01
Author: Gabor Greif <ggreif at gmail.com>
Date: Fri Dec 29 08:30:59 2017 +0100
make 'quux'' test 3 to 2
>---------------------------------------------------------------
46fcad9c42535417769db4a410dbb3f5d7505c01
testsuite/tests/simplStg/should_run/T13861.hs | 11 +++++++++--
testsuite/tests/simplStg/should_run/T13861.stdout | 2 ++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/testsuite/tests/simplStg/should_run/T13861.hs b/testsuite/tests/simplStg/should_run/T13861.hs
index d09b973..9345a4a 100644
--- a/testsuite/tests/simplStg/should_run/T13861.hs
+++ b/testsuite/tests/simplStg/should_run/T13861.hs
@@ -26,12 +26,15 @@ baz _ = Nothing
{-# NOINLINE baz #-}
-data Boo = Tru | Fal
+data Boo = Tru | Fal | Dunno
quux True = Fal
quux False = Tru
{-# NOINLINE quux #-}
+quux' Fal = True
+quux' _ = False
+{-# NOINLINE quux' #-}
nested :: Either Int (Either Int a) -> Either Bool (Maybe a)
@@ -88,7 +91,11 @@ test x = do
let (r48, r49) = (Refl, eq2 r48)
(same $! r48) $! r49 -- no, GADT
let (r50, r51) = (True, quux r50)
- (same $! r50) $! r51 -- yes, quux is identity
+ (same $! r50) $! r51 -- yes, quux is STG identity
+ let (r52, r53) = (Tru, quux' r52)
+ (same $! r52) $! r53 -- no, quux' is not STG identity on 'Tru'
+ let (r54, r55) = (Fal, quux' r54)
+ (same $! r54) $! r55 -- yes, quux' is STG identity on 'Fal'
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 0a6ddab..2e3ae8c 100644
--- a/testsuite/tests/simplStg/should_run/T13861.stdout
+++ b/testsuite/tests/simplStg/should_run/T13861.stdout
@@ -7,6 +7,8 @@ no
no
no
yes
+no
+yes
yes
yes
no
More information about the ghc-commits
mailing list