Commit 3ea8f270 authored by igloo's avatar igloo

[project @ 2003-05-04 13:51:13 by igloo]

Added tests for unboxed literals.
parent 43a4dd0d
-- test the representation of unboxed literals
module Main
where
import GHC.Base
import GHC.Float
import Language.Haskell.THSyntax
import Text.PrettyPrint
main :: IO ()
main = do putStrLn $ show $ $( do e <- [| I# 20# |]
qIO $ putStrLn $ show e
qIO $ putStrLn $ render $ pprExp e
return e )
putStrLn $ show $ $( do e <- [| F# 12.3# |]
qIO $ putStrLn $ show e
qIO $ putStrLn $ render $ pprExp e
return e )
putStrLn $ show $ $( do e <- [| D# 24.6## |]
qIO $ putStrLn $ show e
qIO $ putStrLn $ render $ pprExp e
return e )
App (Con "GHC.Base:I#") (Lit (IntPrim 20))
GHC.Base:I# 20#
App (Con "GHC.Float:F#") (Lit (FloatPrim (123 % 10)))
GHC.Float:F# 12.3#
App (Con "GHC.Float:D#") (Lit (DoublePrim (123 % 5)))
GHC.Float:D# 24.6##
Loading package base ... linking ... done.
Loading package haskell98 ... linking ... done.
Loading package haskell-src ... linking ... done.
-- test the representation of unboxed literals
module Main
where
import GHC.Base
import GHC.Float
import Language.Haskell.THSyntax
import Text.PrettyPrint
main :: IO ()
main = do putStrLn $ show $ $( do e <- [| I# 20# |]
qIO $ putStrLn $ show e
qIO $ putStrLn $ render $ pprExp e
return e )
putStrLn $ show $ $( do e <- [| F# 12.3# |]
qIO $ putStrLn $ show e
qIO $ putStrLn $ render $ pprExp e
return e )
putStrLn $ show $ $( do e <- [| D# 24.6## |]
qIO $ putStrLn $ show e
qIO $ putStrLn $ render $ pprExp e
return e )
......@@ -6,6 +6,8 @@ setTestOpts(only_ways(['normal']));
test('TH_repE1', normal, compile, [''])
test('TH_repE2', normal, compile_and_run, [''])
test('TH_repPrim', normal, compile, [''])
test('TH_repPrimOutput', normal, compile_and_run, [''])
test('TH_reifyDecl1', normal, compile, [''])
test('TH_reifyDecl2', normal, compile, [''])
......
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