summaryrefslogtreecommitdiff
path: root/testsuite/tests/plugins/plugin-recomp/Common.hs
blob: 0ba2b362028a2f6646f168bff237077a62503516 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE CPP #-}
module Common where

import GHC.Plugins

install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
install options todos = do
    putMsgS $ "Simple Plugin Passes Queried"
    putMsgS $ "Got options: " ++ unwords options

    -- Create some actual passes to continue the test.
    return $ CoreDoPluginPass "Main pass" mainPass
             : todos

mainPass :: ModGuts -> CoreM ModGuts
mainPass guts = do
#if defined(RUN2)
    putMsgS "Simple Plugin Pass Run 2"
#else
    putMsgS "Simple Plugin Pass Run"
#endif
    return guts