Commit 77af3438 authored by dimitris's avatar dimitris

Merge branch 'master' of http://darcs.haskell.org/testsuite

parents 0b3c3c81 d6ff372f
module T5664 where
import Foreign
import Foreign.C
data D = D
newtype I = I CInt
foreign import ccall "dynamic"
mkFun1 :: FunPtr (CInt -> IO ()) -> CInt -> IO ()
foreign import ccall "dynamic"
mkFun2 :: FunPtr (I -> IO ()) -> CInt -> IO ()
foreign import ccall "dynamic"
mkFun3 :: FunPtr (D -> IO ()) -> CInt -> IO ()
foreign import ccall "wrapper"
mkCallBack1 :: IO CInt -> IO (FunPtr (IO CInt))
foreign import ccall "wrapper"
mkCallBack2 :: IO CInt -> IO (FunPtr (IO I))
foreign import ccall "wrapper"
mkCallBack3 :: IO CInt -> IO (FunPtr (IO D))
T5664.hs:15:1:
Unacceptable argument type in foreign declaration:
FunPtr (D -> IO ())
When checking declaration:
foreign import ccall safe "dynamic" mkFun3
:: FunPtr (D -> IO ()) -> CInt -> IO ()
T5664.hs:24:1:
Unacceptable result type in foreign declaration: IO (FunPtr (IO D))
When checking declaration:
foreign import ccall safe "wrapper" mkCallBack3
:: IO CInt -> IO (FunPtr (IO D))
......@@ -10,3 +10,4 @@ test('ccfail004', only_compiler_types(['ghc']), multimod_compile_fail, ['ccfail0
test('ccfail005', only_compiler_types(['ghc']), compile_fail, [''])
test('ccall_value', normal, compile_fail, [''])
test('capi_value_function', normal, compile_fail, [''])
test('T5664', normal, compile_fail, ['-v0'])
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}
import qualified T5555_Lib as L
test :: String
test = [L.s|hello world|]
main :: IO ()
main = putStrLn test
module T5555_Lib(s) where
import Language.Haskell.TH
import Language.Haskell.TH.Quote
s :: QuasiQuoter
s = QuasiQuoter expr undefined undefined undefined
expr :: String -> Q Exp
expr = stringE
{-# LANGUAGE TemplateHaskell #-}
$( error ("foo " ++ error "bar") )
T5976.hs:1:1:
Exception when trying to run compile-time code:
bar
Code: error ((++) "foo " error "bar")
{-# LANGUAGE TemplateHaskell #-}
module T5984 where
import T5984_Lib
$nt
$dt
T5984.hs:1:1: Splicing declarations
nt
======>
T5984.hs:7:1-3
newtype Foo = Foo Int
T5984.hs:1:1: Splicing declarations
dt
======>
T5984.hs:8:1-3
data Bar = Bar Int
{-# LANGUAGE TemplateHaskell #-}
module T5984_Lib where
import Language.Haskell.TH
nt :: Q [Dec]
nt = return [NewtypeD [] foo [] (NormalC foo [(NotStrict, ConT ''Int)]) []]
where foo = mkName "Foo"
dt :: Q [Dec]
dt = return [DataD [] bar [] [NormalC bar [(NotStrict, ConT ''Int)]] []]
where bar = mkName "Bar"
......@@ -228,4 +228,8 @@ test('T5886', extra_clean(['T5886a.hi','T5886a.o']),
test('T4135', normal, compile, ['-v0'])
test('T5971', normal, compile_fail, ['-v0 -dsuppress-uniques'])
test('T5968', normal, compile, ['-v0'])
test('T5984', extra_clean(['T5984_Lib.hi', 'T5984_Lib.o']),
multimod_compile, ['T5984', '-v0 -ddump-splices'])
test('T5555', extra_clean(['T5555_Lib.hi', 'T5555_Lib.o']),
multimod_compile, ['T5555', '-v0'])
test('T5976', normal, compile_fail, ['-v0'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment