summaryrefslogtreecommitdiff
path: root/testsuite/tests/plugins/simple-plugin/Simple/TrustworthyPlugin.hs
blob: fb5df22e7dc6615db92c741df1121e4177ad7235 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Simple.TrustworthyPlugin (plugin) where

import GHC.Plugins
import TcRnMonad

plugin :: Plugin
plugin = defaultPlugin
  { renamedResultAction = keepRenamedSource
  , typeCheckResultAction = printHaskellSafeMode
  }
  where
    printHaskellSafeMode _ ms tcg = liftIO $ do
      let dflags = ms_hspp_opts ms
      safe <- finalSafeMode dflags tcg
      print $ gopt Opt_PluginTrustworthy dflags
      putStrLn $ showPpr dflags safe
      return tcg