Update examples
This commit is contained in:
4
testsuite/pdynload/numclass/Makefile
Normal file
4
testsuite/pdynload/numclass/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
TEST= pdynload/numclass
|
||||
TOP=../../..
|
||||
include ../../build.mk
|
5
testsuite/pdynload/numclass/Plugin.hs
Normal file
5
testsuite/pdynload/numclass/Plugin.hs
Normal file
@ -0,0 +1,5 @@
|
||||
module Plugin where
|
||||
|
||||
-- import API
|
||||
|
||||
resource = "error"
|
5
testsuite/pdynload/numclass/api/API.hs
Normal file
5
testsuite/pdynload/numclass/api/API.hs
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
module API where
|
||||
|
||||
data Num t => Interface t = D t
|
||||
|
19
testsuite/pdynload/numclass/prog/Main.hs
Normal file
19
testsuite/pdynload/numclass/prog/Main.hs
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
import System.Plugins
|
||||
import API
|
||||
|
||||
src = "../Plugin.hs"
|
||||
wrap = "../Wrapper.hs"
|
||||
apipath = "../api"
|
||||
|
||||
main = do status <- make src ["-i"++apipath]
|
||||
case status of
|
||||
MakeFailure _ -> putStrLn "make failed"
|
||||
MakeSuccess _ _ -> do {
|
||||
|
||||
;v <- pdynload "../Plugin.o" ["../api"] [] "API.Interface Integer" "resource"
|
||||
;case v of
|
||||
LoadSuccess _ a -> let D i = snd a in putStrLn $ show i
|
||||
_ -> putStrLn "wrong types"
|
||||
|
||||
}
|
1
testsuite/pdynload/numclass/prog/expected
Normal file
1
testsuite/pdynload/numclass/prog/expected
Normal file
@ -0,0 +1 @@
|
||||
wrong types
|
Reference in New Issue
Block a user