summaryrefslogtreecommitdiff
path: root/testsuite/tests/wcompat-warnings/WCompatWarningsOn.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-08-21 12:48:34 -0400
committerBen Gamari <ben@smart-cactus.org>2018-08-21 18:52:42 -0400
commit92db10bc061e0054d0a7504de420b5ad7f72a0a0 (patch)
tree770b244cceac49775da091678903a82526044f4a /testsuite/tests/wcompat-warnings/WCompatWarningsOn.hs
parent8a05836a6cb58274e41aec9e44ea2fa732b2f840 (diff)
downloadhaskell-92db10bc061e0054d0a7504de420b5ad7f72a0a0.tar.gz
testsuite: Deduplicate source in wcompat-warnings test
Diffstat (limited to 'testsuite/tests/wcompat-warnings/WCompatWarningsOn.hs')
-rw-r--r--testsuite/tests/wcompat-warnings/WCompatWarningsOn.hs26
1 files changed, 3 insertions, 23 deletions
diff --git a/testsuite/tests/wcompat-warnings/WCompatWarningsOn.hs b/testsuite/tests/wcompat-warnings/WCompatWarningsOn.hs
index 7d9e7de4fa..9c7598269b 100644
--- a/testsuite/tests/wcompat-warnings/WCompatWarningsOn.hs
+++ b/testsuite/tests/wcompat-warnings/WCompatWarningsOn.hs
@@ -1,26 +1,6 @@
-- Test purpose:
-- Ensure that -Wcompat switches on the right warnings
-{-# LANGUAGE NoMonadFailDesugaring #-}
-{-# OPTIONS_GHC -Wcompat #-}
--- {-# OPTIONS_GHC -Wno-compat #-}
-
-module WCompatWarningsOn where
-
-import qualified Data.Semigroup as Semi
-
-monadFail :: Monad m => m a
-monadFail = do
- Just _ <- undefined
- undefined
-(<>) = undefined -- Semigroup warnings
-
--- -fwarn-noncanonical-monoid-instances
-newtype S = S Int
-
-instance Semi.Semigroup S where
- (<>) = mappend
-
-instance Monoid S where
- S a `mappend` S b = S (a+b)
- mempty = S 0
+{-# OPTIONS_GHC -Wcompat #-}
+{-# LANGUAGE CPP #-}
+#include "Template.hs"