Update examples
This commit is contained in:
17
testsuite/load/null/prog/Main.hs
Normal file
17
testsuite/load/null/prog/Main.hs
Normal file
@ -0,0 +1,17 @@
|
||||
{-# OPTIONS -cpp #-}
|
||||
|
||||
#include "../../../../config.h"
|
||||
|
||||
import System.Plugins
|
||||
import API
|
||||
|
||||
-- an example where we just want to load an object and run it
|
||||
|
||||
main = do
|
||||
let includes = [TOP ++ "/testsuite/load/null/api"]
|
||||
m_v <- load "../Null.o" includes [] "resource"
|
||||
v <- case m_v of
|
||||
LoadSuccess _ v -> return v
|
||||
_ -> error "load failed"
|
||||
|
||||
putStrLn ( show (a v) )
|
1
testsuite/load/null/prog/expected
Normal file
1
testsuite/load/null/prog/expected
Normal file
@ -0,0 +1 @@
|
||||
42
|
Reference in New Issue
Block a user