From adbc8c1893c3906cdabbcef2890d0cb3c26da86f Mon Sep 17 00:00:00 2001
From: Richard Eisenberg <eir@cis.upenn.edu>
Date: Thu, 6 Mar 2014 23:44:57 -0500
Subject: [PATCH] Test #8851.

(cherry picked from commit 1ac91146dc3431742eafd33ed4afc552ca17fb64)

Conflicts:
	testsuite/tests/deriving/should_compile/all.T
---
 .../tests/deriving/should_compile/T8851.hs    | 24 +++++++++++++++++++
 testsuite/tests/deriving/should_compile/all.T |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 testsuite/tests/deriving/should_compile/T8851.hs

diff --git a/testsuite/tests/deriving/should_compile/T8851.hs b/testsuite/tests/deriving/should_compile/T8851.hs
new file mode 100644
index 000000000000..84f0ad4ac1ed
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T8851.hs
@@ -0,0 +1,24 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+
+module T8851 where
+
+import Control.Applicative
+
+class Parsing m where
+  notFollowedBy :: (Monad m, Show a) => m a -> m ()
+
+data Parser a
+instance Parsing Parser where
+  notFollowedBy = undefined
+
+instance Functor Parser where
+  fmap = undefined
+instance Applicative Parser where
+  pure = undefined
+  (<*>) = undefined
+instance Monad Parser where
+  return = undefined
+  (>>=) = undefined
+
+newtype MyParser a = MkMP (Parser a)
+  deriving Parsing
\ No newline at end of file
diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T
index 257a9b215770..4c1f54532490 100644
--- a/testsuite/tests/deriving/should_compile/all.T
+++ b/testsuite/tests/deriving/should_compile/all.T
@@ -45,3 +45,4 @@ test('T8138', reqlib('primitive'), compile, ['-O2'])
 test('T8631', normal, compile, [''])
 test('T8758', extra_clean(['T8758a.o', 'T8758a.hi']), multimod_compile, ['T8758a', '-v0'])
 test('T8865', normal, compile, [''])
+test('T8851', expect_broken(8851), compile, [''])
-- 
GitLab