diff options
Diffstat (limited to 'testsuite/tests/th/TH_repPrim.hs')
-rw-r--r-- | testsuite/tests/th/TH_repPrim.hs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/tests/th/TH_repPrim.hs b/testsuite/tests/th/TH_repPrim.hs new file mode 100644 index 0000000000..2be35b1424 --- /dev/null +++ b/testsuite/tests/th/TH_repPrim.hs @@ -0,0 +1,33 @@ +{-# LANGUAGE MagicHash #-} +-- test the representation of unboxed literals + +module Main where + +import GHC.Exts +import GHC.Float +import Language.Haskell.TH +import Text.PrettyPrint +import System.IO + +main :: IO () +main = do putStrLn $ show $ $( do e <- [| I# 20# |] + runIO $ putStrLn $ show e + runIO $ putStrLn $ pprint e + runIO $ hFlush stdout + return e ) + putStrLn $ show $ $( do e <- [| W# 32## |] + runIO $ putStrLn $ show e + runIO $ putStrLn $ pprint e + runIO $ hFlush stdout + return e ) + putStrLn $ show $ $( do e <- [| F# 12.3# |] + runIO $ putStrLn $ show e + runIO $ putStrLn $ pprint e + runIO $ hFlush stdout + return e ) + putStrLn $ show $ $( do e <- [| D# 24.6## |] + runIO $ putStrLn $ show e + runIO $ putStrLn $ pprint e + runIO $ hFlush stdout + return e ) + |