diff options
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/ghc-api/T12099.hs | 27 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/T12099.stdout | 0 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/all.T | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-api/T12099.hs b/testsuite/tests/ghc-api/T12099.hs new file mode 100644 index 0000000000..d5d5d54445 --- /dev/null +++ b/testsuite/tests/ghc-api/T12099.hs @@ -0,0 +1,27 @@ +module Main where + +import DynFlags + +import Control.Monad +import Data.List + +-- Verify bogus flags aren't printed on flagsForCompletion and +-- allNonDeprecatedFlags: +-- * -fwarn- +-- * -fno-warn- +-- +-- Should print nothing +main :: IO () +main = mapM_ print $ fwarnFlags (flagsForCompletion True) ++ nonDepFwarnFlags + +-- Get flags beginning with -fwarn- and -fno-warn- +fwarnFlags :: [String] -> [String] +fwarnFlags = filter isFwarn + where isFwarn flag = any (flip isPrefixOf $ flag) ["-fwarn-", "-fno-warn"] + +-- Get suggested flags for -fwarn-, -fno-warn- +nonDepFwarnFlags :: [String] +nonDepFwarnFlags = filter isFwarn allNonDeprecatedFlags + where isFwarn "-fwarn-" = True + isFwarn "-fno-warn-" = True + isFwarn _ = False diff --git a/testsuite/tests/ghc-api/T12099.stdout b/testsuite/tests/ghc-api/T12099.stdout new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/testsuite/tests/ghc-api/T12099.stdout diff --git a/testsuite/tests/ghc-api/all.T b/testsuite/tests/ghc-api/all.T index 12c64ebf80..377c1e3987 100644 --- a/testsuite/tests/ghc-api/all.T +++ b/testsuite/tests/ghc-api/all.T @@ -26,3 +26,4 @@ test('T9015', extra_run_opts('"' + config.libdir + '"'), ['-package ghc']) test('T11579', extra_run_opts('"' + config.libdir + '"'), compile_and_run, ['-package ghc']) +test('T12099', normal, compile_and_run, ['-package ghc']) |