From 4b8c44044b7d54b0ca8e3585616bcf7d4dadb1d8 Mon Sep 17 00:00:00 2001 From: panne Date: Thu, 29 Jun 2000 21:08:02 +0000 Subject: [PATCH] [project @ 2000-06-29 21:08:02 by panne] Added test for Typeable instance --- ghc/tests/lib/should_run/Makefile | 3 +- ghc/tests/lib/should_run/dynamic002.hs | 103 ++++++++++++++++++++++++++++ ghc/tests/lib/should_run/dynamic002.stdout | 72 +++++++++++++++++++ 3 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 ghc/tests/lib/should_run/dynamic002.hs create mode 100644 ghc/tests/lib/should_run/dynamic002.stdout diff --git a/ghc/tests/lib/should_run/Makefile b/ghc/tests/lib/should_run/Makefile index 3b3e822..521f66d 100644 --- a/ghc/tests/lib/should_run/Makefile +++ b/ghc/tests/lib/should_run/Makefile @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# $Id: Makefile,v 1.22 2000/06/12 17:01:58 panne Exp $ +# $Id: Makefile,v 1.23 2000/06/29 21:08:02 panne Exp $ TOP = ../.. include $(TOP)/mk/boilerplate.mk @@ -22,6 +22,7 @@ enum03_HC_OPTS = -cpp -fglasgow-exts -H12m stableptr001_RUNTEST_OPTS = +RTS -K4m dynamic001_HC_OPTS = -package lang +dynamic002_HC_OPTS = -package lang io001_HC_OPTS = -fglasgow-exts io002_HC_OPTS = -fglasgow-exts diff --git a/ghc/tests/lib/should_run/dynamic002.hs b/ghc/tests/lib/should_run/dynamic002.hs new file mode 100644 index 0000000..07ff150 --- /dev/null +++ b/ghc/tests/lib/should_run/dynamic002.hs @@ -0,0 +1,103 @@ +-- !!! Testing Typeable instances +module Main(main) where + +import Dynamic +import Array +import Complex +import IO +import Addr +import ForeignObj +import IOExts +import Int +import ST +import StableName +import StablePtr +import Word +import Exception +import ByteArray +import MutableArray +import PackedString +import Weak +import MArray +import IArray +import CTypes +import CTypesISO + +main :: IO () +main = do + print (typeOf (undefined :: [()])) + print (typeOf (undefined :: ())) + print (typeOf (undefined :: ((),()))) + print (typeOf (undefined :: ((),(),()))) + print (typeOf (undefined :: ((),(),(),()))) + print (typeOf (undefined :: ((),(),(),(),()))) + print (typeOf (undefined :: (() -> ()))) + print (typeOf (undefined :: (Array () ()))) + print (typeOf (undefined :: Bool)) + print (typeOf (undefined :: Char)) + print (typeOf (undefined :: (Complex ()))) + print (typeOf (undefined :: Double)) + print (typeOf (undefined :: (Either () ()))) + print (typeOf (undefined :: Float)) + print (typeOf (undefined :: Handle)) + print (typeOf (undefined :: Int)) + print (typeOf (undefined :: Integer)) + print (typeOf (undefined :: IO ())) + print (typeOf (undefined :: (Maybe ()))) + print (typeOf (undefined :: Ordering)) + + print (typeOf (undefined :: Addr)) + print (typeOf (undefined :: AddrOff)) + print (typeOf (undefined :: Dynamic)) + print (typeOf (undefined :: ForeignObj)) + print (typeOf (undefined :: (IORef ()))) + print (typeOf (undefined :: Int8)) + print (typeOf (undefined :: Int16)) + print (typeOf (undefined :: Int32)) + print (typeOf (undefined :: Int64)) + print (typeOf (undefined :: (ST () ()))) + print (typeOf (undefined :: (StableName ()))) + print (typeOf (undefined :: (StablePtr ()))) + print (typeOf (undefined :: TyCon)) + print (typeOf (undefined :: TypeRep)) + print (typeOf (undefined :: Word8)) + print (typeOf (undefined :: Word16)) + print (typeOf (undefined :: Word32)) + print (typeOf (undefined :: Word64)) + + print (typeOf (undefined :: ArithException)) + print (typeOf (undefined :: AsyncException)) + print (typeOf (undefined :: (ByteArray ()))) + print (typeOf (undefined :: Exception)) + print (typeOf (undefined :: (IOArray () ()))) + print (typeOf (undefined :: (IOUArray () ()))) + print (typeOf (undefined :: (MutableByteArray () ()))) + print (typeOf (undefined :: PackedString)) + print (typeOf (undefined :: (STArray () () ()))) + print (typeOf (undefined :: (STUArray () () ()))) + print (typeOf (undefined :: (StableName ()))) + print (typeOf (undefined :: (StablePtr ()))) + print (typeOf (undefined :: (UArray () ()))) + print (typeOf (undefined :: (Weak ()))) + + print (typeOf (undefined :: CChar)) + print (typeOf (undefined :: CSChar)) + print (typeOf (undefined :: CUChar)) + print (typeOf (undefined :: CShort)) + print (typeOf (undefined :: CUShort)) + print (typeOf (undefined :: CInt)) + print (typeOf (undefined :: CUInt)) + print (typeOf (undefined :: CLong)) + print (typeOf (undefined :: CULong)) + print (typeOf (undefined :: CLLong)) + print (typeOf (undefined :: CULLong)) + print (typeOf (undefined :: CFloat)) + print (typeOf (undefined :: CDouble)) + print (typeOf (undefined :: CLDouble)) + + print (typeOf (undefined :: CPtrdiff)) + print (typeOf (undefined :: CSize)) + print (typeOf (undefined :: CWchar)) + print (typeOf (undefined :: CSigAtomic)) + print (typeOf (undefined :: CClock)) + print (typeOf (undefined :: CTime)) diff --git a/ghc/tests/lib/should_run/dynamic002.stdout b/ghc/tests/lib/should_run/dynamic002.stdout new file mode 100644 index 0000000..2fe7d4f --- /dev/null +++ b/ghc/tests/lib/should_run/dynamic002.stdout @@ -0,0 +1,72 @@ +[()] +() +((),()) +((),(),()) +((),(),(),()) +((),(),(),(),()) +() -> () +Array () () +Bool +Char +Complex () +Double +Either () () +Float +Handle +Int +Integer +IO () +Maybe () +Ordering +Addr +AddrOff +Dynamic +ForeignObj +IORef () +Int8 +Int16 +Int32 +Int64 +ST () () +StableName () +StablePtr () +TyCon +TypeRep +Word8 +Word16 +Word32 +Word64 +ArithException +AsyncException +ByteArray () +Exception +IOArray () () +IOUArray () () +MutableByteArray () () +PackedString +STArray () () () +STUArray () () () +StableName () +StablePtr () +UArray () () +Weak () +CChar +CSChar +CUChar +CShort +CUShort +CInt +CUInt +CLong +CULong +CLLong +CULLong +CFloat +CDouble +CLDouble +CPtrdiff +CSize +CWchar +CSigAtomic +CClock +CTime -- 1.7.10.4