[commit: testsuite] master: Test Trac #5776 (b5fd784)
Simon Peyton Jones
simonpj at microsoft.com
Tue Jan 17 13:15:53 CET 2012
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/b5fd784f7de1b80e3a14739619335a4679da683b
>---------------------------------------------------------------
commit b5fd784f7de1b80e3a14739619335a4679da683b
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Tue Jan 17 11:32:00 2012 +0000
Test Trac #5776
>---------------------------------------------------------------
tests/simplCore/should_compile/Makefile | 4 +++
tests/simplCore/should_compile/T5776.hs | 28 ++++++++++++++++++++
.../should_compile/T5776.stdout} | 0
tests/simplCore/should_compile/all.T | 4 +++
4 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/tests/simplCore/should_compile/Makefile b/tests/simplCore/should_compile/Makefile
index b2815ff..2d77e65 100644
--- a/tests/simplCore/should_compile/Makefile
+++ b/tests/simplCore/should_compile/Makefile
@@ -12,6 +12,10 @@ T5658b:
'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5658b.hs -ddump-simpl | grep --count indexIntArray
# Trac 5658 meant that there were three calls to indexIntArray instead of two
+T5776:
+ $(RM) -f T5776.o T5776.hi
+ '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5776.hs -ddump-rules | grep --count dEq
+
T3772:
$(RM) -f T3772*.hi T3772*.o
'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772_A.hs
diff --git a/tests/simplCore/should_compile/T5776.hs b/tests/simplCore/should_compile/T5776.hs
new file mode 100644
index 0000000..df6444f
--- /dev/null
+++ b/tests/simplCore/should_compile/T5776.hs
@@ -0,0 +1,28 @@
+module T5776 where
+
+-- The point about this test is that we should get a rule like this:
+-- "foo" [ALWAYS]
+-- forall (@ a)
+-- ($dEq :: GHC.Classes.Eq a)
+-- ($dEq1 :: GHC.Classes.Eq a)
+-- (x :: a)
+-- (y :: a)
+-- (z :: a).
+-- T5776.f (GHC.Classes.== @ a $dEq1 x y)
+-- (GHC.Classes.== @ a $dEq y z)
+-- = GHC.Types.True
+--
+-- Note the *two* forall'd dEq parameters. This is important.
+-- See Note [Simplifying RULE lhs constraints] in TcSimplify
+
+{-# RULES "foo" forall x y z.
+ f (x == y) (y == z) = True
+ #-}
+
+f :: Bool -> Bool -> Bool
+{-# NOINLINE f #-}
+f a b = False
+
+blah :: Int -> Int -> Bool
+blah x y = f (x==y) (x==y)
+
diff --git a/tests/boxy/T2193.stdout b/tests/simplCore/should_compile/T5776.stdout
similarity index 100%
copy from tests/boxy/T2193.stdout
copy to tests/simplCore/should_compile/T5776.stdout
diff --git a/tests/simplCore/should_compile/all.T b/tests/simplCore/should_compile/all.T
index fb1b58f..6cfec0b 100644
--- a/tests/simplCore/should_compile/all.T
+++ b/tests/simplCore/should_compile/all.T
@@ -138,3 +138,7 @@ test('T5658b',
normal,
run_command,
['$MAKE -s --no-print-directory T5658b'])
+test('T5776',
+ normal,
+ run_command,
+ ['$MAKE -s --no-print-directory T5776'])
More information about the Cvs-ghc
mailing list