diff --git a/doctest.cabal b/doctest.cabal
--- a/doctest.cabal
+++ b/doctest.cabal
@@ -1,5 +1,5 @@
 name:             doctest
-version:          0.11.1
+version:          0.11.2
 synopsis:         Test interactive Haskell examples
 description:      The doctest program checks examples in source code comments.
                   It is modeled after doctest for Python
@@ -51,7 +51,7 @@
   build-depends:
       base          == 4.*
     , base-compat   >= 0.7.0
-    , ghc           >= 7.0 && < 8.2
+    , ghc           >= 7.0 && < 8.4
     , syb           >= 0.3
     , code-page     >= 0.1
     , deepseq
@@ -105,6 +105,7 @@
     , silently      >= 1.2.4
     , setenv
     , with-location
+    , mockery
 
 test-suite doctests
   main-is:
diff --git a/src/GhcUtil.hs b/src/GhcUtil.hs
--- a/src/GhcUtil.hs
+++ b/src/GhcUtil.hs
@@ -20,7 +20,7 @@
 import           Data.IORef (writeIORef)
 #elif __GLASGOW_HASKELL__ < 707
 import           StaticFlags (saveStaticFlagGlobals, restoreStaticFlagGlobals)
-#else
+#elif __GLASGOW_HASKELL__ < 801
 import           StaticFlags (discardStaticFlags)
 #endif
 
@@ -58,8 +58,10 @@
 handleStaticFlags :: [String] -> IO [Located String]
 #if __GLASGOW_HASKELL__ < 707
 handleStaticFlags flags = fst `fmap` parseStaticFlags (map noLoc flags)
-#else
+#elif __GLASGOW_HASKELL__ < 801
 handleStaticFlags flags = return $ map noLoc $ discardStaticFlags flags
+#else
+handleStaticFlags flags = return $ map noLoc $ flags
 #endif
 
 handleDynamicFlags :: GhcMonad m => [Located String] -> m [String]
diff --git a/src/Runner/Example.hs b/src/Runner/Example.hs
--- a/src/Runner/Example.hs
+++ b/src/Runner/Example.hs
@@ -27,13 +27,12 @@
     chunksMatch _ _ = False
 
     matches :: ExpectedResult -> [String] -> Bool
+    matches (ExpectedLine x : xs) (y : ys) = x `chunksMatch` y && xs `matches` ys
+    matches (WildCardLine : xs) ys | xs `matches` ys = True
+    matches zs@(WildCardLine : _) (_ : ys) = zs `matches` ys
     matches [] [] = True
     matches [] _  = False
     matches _  [] = False
-    matches (ExpectedLine x : xs) (y:ys) =
-        x `chunksMatch` y && xs `matches` ys
-    matches zs@(WildCardLine : xs) (_:ys) =
-        xs `matches` ys || zs `matches` ys
 
 
 formatNotEqual :: ExpectedResult -> [String] -> [String]
