Commit 584d954c authored by simonmar's avatar simonmar

[project @ 2000-12-12 17:21:40 by simonmar]

Take a pass over the tests, get most things working again.  Mostly
-package lang changes, and synching up of the expected output.

This was a good exercise though: I found at least two real bugs in the
process :)
parent baa3f2a9
# -----------------------------------------------------------------------------
# $Id: Makefile,v 1.4 2000/12/12 17:21:40 simonmar Exp $
TOP = ../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/should_run.mk
SRC_HC_OPTS += -dcore-lint
arr014_HC_OPTS = -fglasgow-exts
arr014_HC_OPTS = -package lang
arr003_RUNTEST_OPTS = -x 1
arr004_RUNTEST_OPTS = -x 1
......@@ -12,6 +15,6 @@ arr007_RUNTEST_OPTS = -x 1
arr008_RUNTEST_OPTS = -x 1
# mkdependHS doesn't understand OPTIONS pragmas...
SRC_MKDEPENDHS_OPTS += -fglasgow-exts
SRC_MKDEPENDHS_OPTS += -package lang
include $(TOP)/mk/target.mk
{-# OPTIONS -fglasgow-exts #-}
-- !!! multi-dimensional arrays
module Main ( main ) where
......
# -----------------------------------------------------------------------------
# $Id: Makefile,v 1.12 2000/12/12 17:21:40 simonmar Exp $
TOP = ../..
HCOnly = YES
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/should_compile.mk
SRC_HC_OPTS += -dcore-lint -fglasgow-exts
SRC_HC_OPTS += -dcore-lint -fglasgow-exts -package lang
# Note that these tests are still in a state of flux... don't believe errors
# they report. In fact, these aren't really very good tests at all...
......
......@@ -2,6 +2,6 @@ TOP = ../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/should_fail.mk
SRC_HC_OPTS += -fglasgow-exts
SRC_HC_OPTS += -fglasgow-exts -package lang
include $(TOP)/mk/target.mk
cc001.hs:5:
Ambiguous type variable(s) `t' in the constraint `CCallable t'
Ambiguous type variable(s) `t'
in the constraint `PrelGHC.CCallable t'
arising from an argument in the _ccall_ to `foo', namely `(undefined ())' at cc001.hs:5
In the right-hand side of an equation for `f':
_ccall_ foo (undefined ())
Compilation had errors
cc002.hs:10:
No instance for `CReturnable ForeignObj'
No instance for `PrelGHC.CReturnable ForeignObj'
arising from the result of the _ccall_ to `a' at cc002.hs:10
In the right-hand side of an equation for `a': _ccall_ a
Compilation had errors
cc004.hs:2:
Cannot generalise these overloadings (in a _ccall_):
`CReturnable b' arising from the result of the _ccall_ to `f' at cc004.hs:8
cc004.hs:2:
Cannot generalise these overloadings (in a _ccall_):
`CReturnable t_aMc' arising from the result of the _ccall_ to `f' at cc004.hs:15
Compilation had errors
Cannot generalise these overloadings (in a _ccall_):
`PrelGHC.CReturnable a' arising from the result of the _ccall_ to `f' at cc004.hs:8
Cannot generalise these overloadings (in a _ccall_):
`PrelGHC.CReturnable a' arising from the result of the _ccall_ to `f' at cc004.hs:15
......@@ -8,6 +8,3 @@ cc005.hs:10:
Unacceptable result type in foreign declaration: Int#
When checking declaration:
foreign export _ccall "bar" bar :: Int -> Int#
Compilation had errors
#-----------------------------------------------------------------------------
# $Id: Makefile,v 1.5 2000/06/12 17:01:57 panne Exp $
# $Id: Makefile,v 1.6 2000/12/12 17:21:40 simonmar Exp $
TOP = ../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/should_run.mk
SRC_HC_OPTS += -dcore-lint -fglasgow-exts
SRC_HC_OPTS += -dcore-lint -fglasgow-exts -package lang
callback_HC_OPTS += -fvia-C
......
#-----------------------------------------------------------------------------
# $Id: Makefile,v 1.15 2000/11/03 16:23:37 simonmar Exp $
# $Id: Makefile,v 1.16 2000/12/12 17:21:40 simonmar Exp $
TOP = ../..
include $(TOP)/mk/boilerplate.mk
......@@ -18,16 +18,16 @@ SRC_HC_OPTS += -dcore-lint
cg012_HC_OPTS = -fglasgow-exts
cg015_HC_OPTS = -fglasgow-exts
cg018_HC_OPTS = -fglasgow-exts
cg025_HC_OPTS = -fglasgow-exts
cg026_HC_OPTS = -fglasgow-exts -fvia-C
cg029_HC_OPTS = -fglasgow-exts
cg030_HC_OPTS = -fglasgow-exts
cg025_HC_OPTS = -package lang
cg026_HC_OPTS = -package lang -fglasgow-exts -fvia-C
cg029_HC_OPTS = -package lang -fglasgow-exts
cg030_HC_OPTS = -package lang -fglasgow-exts
cg031_HC_OPTS = -fglasgow-exts
cg032_HC_OPTS = -fglasgow-exts
cg033_HC_OPTS = -fglasgow-exts
cg035_HC_OPTS = -fglasgow-exts
cg042_HC_OPTS = -fglasgow-exts
cg044_HC_OPTS = -fglasgow-exts
cg035_HC_OPTS = -package lang -fglasgow-exts
cg042_HC_OPTS = -package lang -fglasgow-exts
cg044_HC_OPTS = -package lang
cg016_RUNTEST_OPTS = -x 1 # should override the -x 0 above.
cg021_RUNTEST_OPTS = +RTS -K2m
......
......@@ -4,9 +4,9 @@ include $(TOP)/mk/should_compile.mk
SRC_HC_OPTS += -dcore-lint
ds035_HC_OPTS = -fglasgow-exts
ds035_HC_OPTS = -fglasgow-exts -package lang
ds046_HC_OPTS = -O -funbox-strict-fields
ds049_HC_OPTS = -fvia-C
ds049_HC_OPTS = -fvia-C -package lang
ds050_HC_OPTS = -fglasgow-exts
# mkdependHS doesn't understand OPTIONS pragmas...
......
ds040.hs:7: Pattern match(es) are overlapped in the definition of function `^^^^':
ds040.hs:9: Pattern match(es) are overlapped in the definition of function `^^^^':
^^^^ _ _ = ...
drvfail001.hs:11:
No instance for `Show (f (f a))'
When deriving classes for `SM'
Compilation had errors
No instance for `Show (f a)'
When deriving classes for `Cons'
drvfail004.hs:5:
Could not deduce `Eq (Foo a b)'
from the context (Ord a1, Ord b1)
Could not deduce `Eq (Foo a b)' from the context (Ord a, Ord b)
Probable fix:
Add `Eq (Foo a b)' to the instance declaration context
Or add an instance declaration for `Eq (Foo a b)'
arising from an instance declaration at drvfail004.hs:5
Compilation had errors
drvfail007.hs:2:
No instance for `Eq (Int -> Int)'
When deriving classes for `Foo'
Compilation had errors
No instance for `Eq (Int -> Int)'
When deriving classes for `Foo'
......@@ -10,12 +10,11 @@ endif
include $(TOP)/mk/should_run.mk
SRC_HC_OPTS += -dcore-lint
io022_HC_OPTS += -fglasgow-exts
io010_HC_OPTS += -fglasgow-exts
io011_HC_OPTS += -fglasgow-exts
io018_HC_OPTS += -fglasgow-exts
io030_HC_OPTS += -fglasgow-exts
io032_HC_OPTS += -fglasgow-exts
io011_HC_OPTS += -fglasgow-exts -package lang
io018_HC_OPTS += -fglasgow-exts -package lang
io022_HC_OPTS += -fglasgow-exts -package lang
io032_HC_OPTS += -fglasgow-exts -package lang
io004_RUNTEST_OPTS += -x 42
io016_RUNTEST_OPTS += io016.hs io016.out
......
Smoewnst pa ihyu
Caught EOF
Smoewnst pa ihyu
S-m-o e!w!n
Caught EOF
Smoewnst pa ihyu
S-m-o e!w!n!s tT epsat iinhgy uR!s tT epsat iinhgy uRW handles
module Main(main) where
import IO
import IOExts
import Directory (removeFile, doesFileExist)
import Monad
-- This test is weird, full marks to whoever dreamt it up!
main :: IO ()
main = do
let username = "io018.inout"
f <- doesFileExist username
when f (removeFile username)
cd <- openFile username ReadWriteMode
hSetBinaryMode cd True
hSetBuffering stdin NoBuffering
hSetBuffering stdout NoBuffering
hSetBuffering cd NoBuffering
hPutStr cd speakString
hSeek cd AbsoluteSeek 0
speak cd `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else ioError err
hSeek cd AbsoluteSeek 0
hSetBuffering cd LineBuffering
speak cd `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else ioError err
hSeek cd AbsoluteSeek 0
hSetBuffering cd (BlockBuffering Nothing)
speak cd `catch` \ err -> if isEOFError err then putStrLn "\nCaught EOF" else ioError err
speakString = "Someone wants to speak with you\n"
speak cd = do
(do
ready <- hReady cd
if ready then
hGetChar cd >>= putChar
else
return ()
ready <- hReady stdin
if ready then (do { ch <- ge
Caught EOF
......@@ -48,3 +48,153 @@ ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
#-----------------------------------------------------------------------------
# $Id: Makefile,v 1.24 2000/09/04 15:23:55 simonmar Exp $
# $Id: Makefile,v 1.25 2000/12/12 17:21:41 simonmar Exp $
TOP = ../..
include $(TOP)/mk/boilerplate.mk
......@@ -8,30 +8,29 @@ include $(TOP)/mk/should_run.mk
SRC_HC_OPTS += -dcore-lint
packedstring001_HC_OPTS = -package lang
exceptions001_HC_OPTS = -fglasgow-exts -fno-warn-missing-methods
stableptr001_HC_OPTS = -fglasgow-exts
stableptr002_HC_OPTS = -fglasgow-exts
stableptr003_HC_OPTS = -fglasgow-exts
stableptr004_HC_OPTS = -fglasgow-exts
list001_HC_OPTS = -fglasgow-exts
exceptions001_HC_OPTS = -package lang -fno-warn-missing-methods
stableptr001_HC_OPTS = -package lang
stableptr002_HC_OPTS = -package lang -fglasgow-exts
stableptr003_HC_OPTS = -package lang
stableptr004_HC_OPTS = -package lang
list001_HC_OPTS = -package lang
uri001_HC_OPTS = -package lang -package net
time001_HC_OPTS = -package lang
io001_HC_OPTS = -package lang
io002_HC_OPTS = -package lang
addr001_HC_OPTS = -package lang
enum01_HC_OPTS = -cpp -fglasgow-exts -H12m
enum02_HC_OPTS = -cpp -fglasgow-exts -H12m
enum03_HC_OPTS = -cpp -fglasgow-exts -H12m
enum01_HC_OPTS = -cpp -package lang -H12m
enum02_HC_OPTS = -cpp -package lang -H12m
enum03_HC_OPTS = -cpp -package lang -H12m
stableptr001_RUNTEST_OPTS = +RTS -K4m
stableptr004_RUNTEST_OPTS = +RTS -K4m
dynamic001_HC_OPTS = -package lang
dynamic002_HC_OPTS = -package lang
io001_HC_OPTS = -fglasgow-exts
io002_HC_OPTS = -fglasgow-exts
addr001_HC_OPTS = -fglasgow-exts
ioexts001_HC_OPTS = -fglasgow-exts -O
ioexts001_RUNTEST_OPTS = +RTS -K8m
ioexts001_HC_OPTS = -package lang -O
ioexts001_RUNTEST_OPTS = +RTS -K16m
memo001_HC_OPTS = -package lang -package util
# stress the garbage collector a bit, to make sure weak pointers are being
......@@ -41,7 +40,7 @@ memo001_RUNTEST_OPTS = +RTS -A10k -G1
memo002_HC_OPTS = -package lang -package util
memo002_RUNTEST_OPTS = 20
weak001_HC_OPTS = -fglasgow-exts
weak001_HC_OPTS = -package lang -fglasgow-exts
SRC_MKDEPENDHS_OPTS += -package lang
......
......@@ -3,8 +3,8 @@ lex '\x0f2' = [("'\\x0f2'","")]
lex '\xf2' = [("'\\xf2'","")]
lex '\xf2t' = []
lex '\X24' = [("'\\x24'","")]
lex '\x24b' = []
lex '\Xa4b' = []
lex '\x24b' = [("'\\x24b'","")]
lex '\Xa4b' = [("'\\xa4b'","")]
lex '\xa4bg' = []
lex '\o00' = [("'\\o00'","")]
lex '\o05' = [("'\\o05'","")]
......
......@@ -47,7 +47,6 @@ main = do
print (typeOf (undefined :: Ordering))
print (typeOf (undefined :: Addr))
print (typeOf (undefined :: AddrOff))
print (typeOf (undefined :: Dynamic))
print (typeOf (undefined :: ForeignObj))
print (typeOf (undefined :: (IORef ())))
......
......@@ -19,7 +19,6 @@ IO ()
Maybe ()
Ordering
Addr
AddrOff
Dynamic
ForeignObj
IORef ()
......
......@@ -480,14 +480,7 @@ testEnumRatioInt = do
--
mayBomb x = catchAllIO x errorHandler
errorHandler :: Exception -> IO ()
errorHandler e =
case justErrors e of
Just t -> putStrLn ("error " ++ show t)
_ -> return ()
mayBomb x = catchJust errorCalls x (\e -> putStrLn ("error " ++ show e))
test :: Show a => String -> String -> a -> IO ()
test test_nm expected val = do
......
......@@ -62,13 +62,13 @@ Testing Enum Char:
(succ (minBound::Char)) = '\SOH'
(succ (maxBound::Char)) = error "Prelude.Enum.Char.succ: bad argument"
(pred 'b') = 'a'
pred (maxBound::Char) = '\254'
pred (maxBound::Char) = '\2147483646'
pred (minBound::Char) = error "Prelude.Enum.Char.pred: bad argument"
(map (toEnum::Int->Char) [123,ord (minBound::Char), ord(maxBound::Char)]) = "{\NUL\255"
(map (toEnum::Int->Char) [123,ord (minBound::Char), ord(maxBound::Char)]) = "{\NUL\2147483647"
(toEnum::Int->Char) (minBound::Int) = error "Prelude.chr: bad argument"
(map fromEnum ['X',minBound,maxBound]) = [88,0,255]
(map fromEnum ['X',minBound,maxBound]) = [88,0,2147483647]
(take 7 ['\NUL' .. ]) = "\NUL\SOH\STX\ETX\EOT\ENQ\ACK"
(take 7 ['\250' .. ]) = "\250\251\252\253\254\255"
(take 7 ['\250' .. ]) = "\250\251\252\253\254\255\256"
(take 7 ['a','b'..]) = "abcdefg"
(take 7 ['a','e'..]) = "aeimquy"
(take 7 ['a','a'..]) = "aaaaaaa"
......@@ -76,7 +76,7 @@ Testing Enum Char:
(take 7 ['z','v'..]) = "zvrnjfb"
(take 7 ['\1', '\0' ..]) = "\SOH\NUL"
(take 7 ['\5', '\4' ..]) = "\ENQ\EOT\ETX\STX\SOH\NUL"
(take 7 ['\250', '\251' ..]) = "\250\251\252\253\254\255"
(take 7 ['\250', '\251' ..]) = "\250\251\252\253\254\255\256"
(take 7 (['a' .. 'e'])) = "abcde"
(take 4 (['a' .. 'a'])) = "a"
(take 7 (['b' .. 'a'])) = ""
......@@ -90,7 +90,7 @@ Testing Enum Char:
(take 7 ['c','b' .. 'c']) = "c"
(take 7 ['c','b' .. 'b']) = "cb"
(take 7 ['c','d' .. 'b']) = ""
(take 7 ['\251', '\252' .. maxBound]) = "\251\252\253\254\255"
(take 7 ['\251', '\252' .. maxBound]) = "\251\252\253\254\255\256\257"
(take 7 ['\5', '\4' .. minBound]) = "\ENQ\EOT\ETX\STX\SOH\NUL"
Testing Enum ():
(succ ()) = error "Prelude.Enum.().succ: bad argment"
......
......@@ -258,11 +258,4 @@ testEnumInt64 = do
--
mayBomb x = catchAllIO x errorHandler
errorHandler :: Exception -> IO ()
errorHandler e =
case justErrors e of
Just t -> putStrLn ("error " ++ show t)
_ -> return ()