Add a manual testcase for the "not interpreted" issue
This commit is contained in:
parent
0fde762500
commit
6f0eb46db9
37
test/manual/not-interpreted-error/GhcTestcase.hs
Normal file
37
test/manual/not-interpreted-error/GhcTestcase.hs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
-- $ ghc -package ghc -package ghc-paths GhcTestcase.hs
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
import GHC
|
||||||
|
import GHC.Paths (libdir)
|
||||||
|
import DynFlags
|
||||||
|
|
||||||
|
import System.Environment
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = do
|
||||||
|
args <- getArgs
|
||||||
|
defaultErrorHandler defaultFatalMessager defaultFlushOut $
|
||||||
|
runGhc (Just libdir) $
|
||||||
|
doStuff "Main.hs" "Main" args
|
||||||
|
|
||||||
|
doStuff :: String -> String -> [String] -> Ghc ()
|
||||||
|
doStuff targetFile targetModule args = do
|
||||||
|
dflags0 <- getSessionDynFlags
|
||||||
|
let dflags1 = dflags0 {
|
||||||
|
ghcMode = CompManager
|
||||||
|
, ghcLink = LinkInMemory
|
||||||
|
, hscTarget = HscInterpreted
|
||||||
|
, optLevel = 0
|
||||||
|
}
|
||||||
|
(dflags2, _, _) <- parseDynamicFlags dflags1 (map noLoc args)
|
||||||
|
_ <- setSessionDynFlags dflags2
|
||||||
|
|
||||||
|
target <- guessTarget targetFile Nothing
|
||||||
|
setTargets [target { targetAllowObjCode = True }]
|
||||||
|
|
||||||
|
_ <- load LoadAllTargets
|
||||||
|
|
||||||
|
setContext [IIModule $ mkModuleName targetModule]
|
||||||
|
|
||||||
|
return ()
|
187
test/manual/not-interpreted-error/bad.gm
Normal file
187
test/manual/not-interpreted-error/bad.gm
Normal file
File diff suppressed because one or more lines are too long
189
test/manual/not-interpreted-error/good.gm
Normal file
189
test/manual/not-interpreted-error/good.gm
Normal file
File diff suppressed because one or more lines are too long
5
test/manual/not-interpreted-error/proj/Main.hs
Normal file
5
test/manual/not-interpreted-error/proj/Main.hs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
module Main where
|
||||||
|
|
||||||
|
import A
|
||||||
|
|
||||||
|
main = print foo
|
@ -0,0 +1,12 @@
|
|||||||
|
name: not-interpreted-error
|
||||||
|
version: 0.1.0.0
|
||||||
|
license-file: LICENSE
|
||||||
|
author: asdf
|
||||||
|
maintainer: asdf
|
||||||
|
build-type: Simple
|
||||||
|
cabal-version: >=1.10
|
||||||
|
|
||||||
|
executable main
|
||||||
|
main-is: Main.hs
|
||||||
|
build-depends: base
|
||||||
|
default-language: Haskell2010
|
Loading…
Reference in New Issue
Block a user