[commit: ghc] master: Add a broken test case for #12689 (f8d2c20)

git at git.haskell.org git at git.haskell.org
Tue Oct 11 20:52:11 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f8d2c205e04bcb83d39ccbede4c2a6279f702a6b/ghc

>---------------------------------------------------------------

commit f8d2c205e04bcb83d39ccbede4c2a6279f702a6b
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Oct 11 16:50:25 2016 -0400

    Add a broken test case for #12689
    
    A rule with a phase specification trying to match on a constructor with
    a wrapper will fail to match, as the wrapper will be inlined by then.
    The fact that it works in the other case is also mostly by accident.
    (Split into two test cases so that regressions with regard what works so
    far are caught.)


>---------------------------------------------------------------

f8d2c205e04bcb83d39ccbede4c2a6279f702a6b
 testsuite/tests/simplCore/should_run/T12689broken.hs     | 9 +++++++++
 testsuite/tests/simplCore/should_run/T12689broken.stdout | 1 +
 testsuite/tests/simplCore/should_run/all.T               | 1 +
 3 files changed, 11 insertions(+)

diff --git a/testsuite/tests/simplCore/should_run/T12689broken.hs b/testsuite/tests/simplCore/should_run/T12689broken.hs
new file mode 100644
index 0000000..cb83cc4
--- /dev/null
+++ b/testsuite/tests/simplCore/should_run/T12689broken.hs
@@ -0,0 +1,9 @@
+data T6 = MkT6Bad {-# UNPACK #-} !Int | MkT6Good {-# UNPACK #-} !Int deriving Show
+
+{-# RULES
+
+"T6" [1] forall x. MkT6Bad x = MkT6Good x
+  #-}
+
+main = do
+  print (MkT6Bad 42) -- late rule
diff --git a/testsuite/tests/simplCore/should_run/T12689broken.stdout b/testsuite/tests/simplCore/should_run/T12689broken.stdout
new file mode 100644
index 0000000..75ff341
--- /dev/null
+++ b/testsuite/tests/simplCore/should_run/T12689broken.stdout
@@ -0,0 +1 @@
+MkT6Good 42
diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T
index 1e4e8a7..733f158 100644
--- a/testsuite/tests/simplCore/should_run/all.T
+++ b/testsuite/tests/simplCore/should_run/all.T
@@ -74,4 +74,5 @@ test('T11172', normal, compile_and_run, [''])
 test('T11731', normal, compile_and_run, ['-fspec-constr'])
 test('T7611', normal, compile_and_run, [''])
 test('T12689', normal, compile_and_run, [''])
+test('T12689broken', expect_broken(12689), compile_and_run, [''])
 test('T12689a', normal, compile_and_run, [''])



More information about the ghc-commits mailing list