summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_run
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2014-11-27 15:44:10 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2014-11-27 15:44:10 +0000
commit01f03cb30426fad1b848051fa142c04c8816a80c (patch)
tree34564d11f0def9aea208aea4b4f769d0a2a12527 /testsuite/tests/deriving/should_run
parentb61091d3b042305ce21bb00b28a81f903b522394 (diff)
downloadhaskell-01f03cb30426fad1b848051fa142c04c8816a80c.tar.gz
Get the right fixity-env in standalone deriving (Trac #9830)
Diffstat (limited to 'testsuite/tests/deriving/should_run')
-rw-r--r--testsuite/tests/deriving/should_run/T9830.hs13
-rw-r--r--testsuite/tests/deriving/should_run/T9830.stdout4
-rw-r--r--testsuite/tests/deriving/should_run/T9830a.hs4
-rw-r--r--testsuite/tests/deriving/should_run/all.T2
4 files changed, 22 insertions, 1 deletions
diff --git a/testsuite/tests/deriving/should_run/T9830.hs b/testsuite/tests/deriving/should_run/T9830.hs
new file mode 100644
index 0000000000..353decc347
--- /dev/null
+++ b/testsuite/tests/deriving/should_run/T9830.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE StandaloneDeriving #-}
+module Main where
+
+import T9830a
+
+deriving instance (Show a, Show b) => Show (ADT a b)
+
+main :: IO ()
+main = do
+ putStrLn $ "Prec 6: " ++ showsPrec 6 ("test" :?: "show") ""
+ putStrLn $ "Prec 7: " ++ showsPrec 7 ("test" :?: "show") ""
+ putStrLn $ "Prec 9: " ++ showsPrec 9 ("test" :?: "show") ""
+ putStrLn $ "Prec 10: " ++ showsPrec 10 ("test" :?: "show") ""
diff --git a/testsuite/tests/deriving/should_run/T9830.stdout b/testsuite/tests/deriving/should_run/T9830.stdout
new file mode 100644
index 0000000000..7d9bbe5bde
--- /dev/null
+++ b/testsuite/tests/deriving/should_run/T9830.stdout
@@ -0,0 +1,4 @@
+Prec 6: "test" :?: "show"
+Prec 7: ("test" :?: "show")
+Prec 9: ("test" :?: "show")
+Prec 10: ("test" :?: "show")
diff --git a/testsuite/tests/deriving/should_run/T9830a.hs b/testsuite/tests/deriving/should_run/T9830a.hs
new file mode 100644
index 0000000000..1b2ef17cbc
--- /dev/null
+++ b/testsuite/tests/deriving/should_run/T9830a.hs
@@ -0,0 +1,4 @@
+module T9830a where
+
+infixr 6 :?:
+data ADT a b = a :?: b deriving (Eq, Ord, Read)
diff --git a/testsuite/tests/deriving/should_run/all.T b/testsuite/tests/deriving/should_run/all.T
index 21c1962ed1..58b4903698 100644
--- a/testsuite/tests/deriving/should_run/all.T
+++ b/testsuite/tests/deriving/should_run/all.T
@@ -37,4 +37,4 @@ test('T5712', normal, compile_and_run, [''])
test('T7931', normal, compile_and_run, [''])
test('T8280', normal, compile_and_run, [''])
test('T9576', exit_code(1), compile_and_run, [''])
-
+test('T9830', normal, multimod_compile_and_run, ['T9830','-v0'])