Commit 37c33c55 authored by Simon Peyton Jones's avatar Simon Peyton Jones

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

Conflicts:
	tests/polykinds/all.T
parents 7d7c728d e19b6fd1
......@@ -26,7 +26,10 @@ config.other_ways = ['extcore','optextcore',
'prof_hc_hb','prof_hb',
'prof_hd','prof_hy','prof_hr',
'threaded1_ls', 'threaded2_hT',
'llvm', 'debugllvm' ]
'llvm', 'debugllvm',
'profllvm', 'profoptllvm', 'profthreadedllvm',
'threaded1llvm', 'threaded2llvm',
'dynllvm']
if (ghc_with_native_codegen == 1):
config.compile_ways.append('optasm')
......@@ -86,7 +89,14 @@ config.way_flags = {
'prof_hd' : ['-O', '-prof', '-auto-all'],
'prof_hy' : ['-O', '-prof', '-auto-all'],
'prof_hr' : ['-O', '-prof', '-auto-all'],
'dyn' : ['-O', '-dynamic']
'dyn' : ['-O', '-dynamic'],
# llvm variants...
'profllvm' : ['-prof', '-auto-all', '-fllvm'],
'profoptllvm' : ['-O', '-prof', '-auto-all', '-fllvm'],
'profthreadedllvm' : ['-O', '-prof', '-auto-all', '-threaded', '-fllvm'],
'threaded1llvm' : ['-threaded', '-debug', '-fllvm'],
'threaded2llvm' : ['-O', '-threaded', '-eventlog', '-fllvm'],
'dynllvm' : ['-O', '-dynamic', '-fllvm']
}
config.way_rts_flags = {
......@@ -112,7 +122,14 @@ config.way_rts_flags = {
'prof_hd' : ['-hd'],
'prof_hy' : ['-hy'],
'prof_hr' : ['-hr'],
'dyn' : []
'dyn' : [],
# llvm variants...
'profllvm' : ['-p'],
'profoptllvm' : ['-hc', '-p'],
'profthreadedllvm' : ['-p'],
'threaded1llvm' : [],
'threaded2llvm' : ['-N2 -ls'],
'dynllvm' : []
}
# Useful classes of ways that can be used with only_ways() and
......
......@@ -255,6 +255,9 @@ class TestOptions:
# Should we redirect stdout and stderr to a single file?
self.combined_output = False
# How should the timeout be adjusted on this test?
self.timeout_multiplier = 1.0
# The default set of options
global default_testopts
default_testopts = TestOptions()
......
......@@ -14,6 +14,7 @@ import traceback
import copy
import glob
import types
import math
have_subprocess = False
try:
......@@ -218,6 +219,14 @@ def _exit_code( opts, v ):
# -----
def timeout_multiplier( val ):
return lambda opts, v=val: _timeout_multiplier(opts, v)
def _timeout_multiplier( opts, v ):
opts.timeout_multiplier = v
# -----
def extra_run_opts( val ):
return lambda opts, v=val: _extra_run_opts(opts, v);
......@@ -1156,7 +1165,7 @@ def simple_run( name, way, prog, args ):
my_rts_flags = rts_flags(way)
stats_file = name + '.stats'
if len(opts.stats_num_fields) > 0:
if len(opts.stats_num_fields) + len(opts.stats_range_fields) > 0:
args += ' +RTS -V0 -t' + stats_file + ' --machine-readable -RTS'
if opts.no_stdin:
......@@ -1176,13 +1185,13 @@ def simple_run( name, way, prog, args ):
+ stdin_comes_from \
+ redirection
if getTestOpts().cmd_wrapper != None:
cmd = getTestOpts().cmd_wrapper(cmd);
if opts.cmd_wrapper != None:
cmd = opts.cmd_wrapper(cmd);
cmd = 'cd ' + getTestOpts().testdir + ' && ' + cmd
cmd = 'cd ' + opts.testdir + ' && ' + cmd
# run the command
result = runCmdFor(name, cmd)
result = runCmdFor(name, cmd, timeout_multiplier=opts.timeout_multiplier)
exit_code = result >> 8
signal = result & 0xff
......@@ -1198,9 +1207,11 @@ def simple_run( name, way, prog, args ):
check_prof = my_rts_flags.find("-p") != -1
if not opts.ignore_output:
if not opts.combined_output and not check_stderr_ok(name):
bad_stderr = not opts.combined_output and not check_stderr_ok(name)
bad_stdout = not check_stdout_ok(name)
if bad_stderr:
return failBecause('bad stderr')
if not check_stdout_ok(name):
if bad_stdout:
return failBecause('bad stdout')
# exit_code > 127 probably indicates a crash, so don't try to run hp2ps.
if check_hp and (exit_code <= 127 or exit_code == 251) and not check_hp_ok(name):
......@@ -1285,7 +1296,7 @@ def interpreter_run( name, way, extra_hc_opts, compile_only, top_mod ):
cmd = 'cd ' + getTestOpts().testdir + " && " + cmd
result = runCmdFor(name, cmd)
result = runCmdFor(name, cmd, timeout_multiplier=getTestOpts().timeout_multiplier)
exit_code = result >> 8
signal = result & 0xff
......@@ -1712,23 +1723,24 @@ def runCmd( cmd ):
r = os.system(cmd)
return r << 8
def runCmdFor( name, cmd ):
def runCmdFor( name, cmd, timeout_multiplier=1.0 ):
if_verbose( 1, cmd )
r = 0
if config.os == 'mingw32':
# On MinGW, we will always have timeout
assert config.timeout_prog!=''
timeout = int(math.ceil(config.timeout * timeout_multiplier))
if config.timeout_prog != '':
if config.check_files_written:
fn = name + ".strace"
r = rawSystem(["strace", "-o", fn, "-fF", "-e", "creat,open,chdir,clone,vfork",
config.timeout_prog, str(config.timeout),
config.timeout_prog, str(timeout),
cmd])
addTestFilesWritten(name, fn)
rm_no_fail(fn)
else:
r = rawSystem([config.timeout_prog, str(config.timeout), cmd])
r = rawSystem([config.timeout_prog, str(timeout), cmd])
else:
r = os.system(cmd)
return r << 8
......
......@@ -2,7 +2,5 @@
annfail05.hs:11:1:
No instance for (Data.Data.Data NoInstances)
arising from an annotation
Possible fix:
add an instance declaration for (Data.Data.Data NoInstances)
In the expression: NoInstances
In the annotation: {-# ANN f NoInstances #-}
......@@ -2,13 +2,10 @@
annfail08.hs:9:1:
No instance for (Data.Data.Data (a0 -> a0))
arising from an annotation
Possible fix:
add an instance declaration for (Data.Data.Data (a0 -> a0))
In the expression: (id + 1)
In the annotation: {-# ANN f (id + 1) #-}
annfail08.hs:9:15:
No instance for (Num (a0 -> a0)) arising from a use of `+'
Possible fix: add an instance declaration for (Num (a0 -> a0))
In the expression: (id + 1)
In the annotation: {-# ANN f (id + 1) #-}
T5380.hs:7:27:
Couldn't match expected type `not_bool' with actual type `Bool'
`not_bool' is a rigid type variable bound by
the type signature for
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:6:10
In the expression: b
In the expression: proc () -> if b then f -< () else f -< ()
In an equation for `testB':
testB b f = proc () -> if b then f -< () else f -< ()
T5380.hs:7:34:
Couldn't match type `not_unit' with `()'
`not_unit' is a rigid type variable bound by
the type signature for
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:6:10
Expected type: () -> not_unit
Actual type: () -> ()
In the expression: f
In the expression: proc () -> if b then f -< () else f -< ()
In an equation for `testB':
testB b f = proc () -> if b then f -< () else f -< ()
T5380.hs:7:27:
Couldn't match expected type `Bool' with actual type `not_bool'
`not_bool' is a rigid type variable bound by
the type signature for
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:6:10
Relevant bindings include
testB :: not_bool -> (() -> ()) -> () -> not_unit
(bound at T5380.hs:7:1)
b :: not_bool (bound at T5380.hs:7:7)
In the expression: b
In the expression: proc () -> if b then f -< () else f -< ()
In an equation for `testB':
testB b f = proc () -> if b then f -< () else f -< ()
T5380.hs:7:34:
Couldn't match type `not_unit' with `()'
`not_unit' is a rigid type variable bound by
the type signature for
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:6:10
Expected type: () -> not_unit
Actual type: () -> ()
Relevant bindings include
testB :: not_bool -> (() -> ()) -> () -> not_unit
(bound at T5380.hs:7:1)
In the expression: f
In the expression: proc () -> if b then f -< () else f -< ()
In an equation for `testB':
testB b f = proc () -> if b then f -< () else f -< ()
arrowfail001.hs:16:36:
No instance for (Foo a)
arising from a use of `foo'
In the expression: foo
In the expression: proc x -> case x of { Bar a -> foo -< a }
In an equation for `get':
get = proc x -> case x of { Bar a -> foo -< a }
arrowfail001.hs:16:36:
No instance for (Foo a) arising from a use of `foo'
In the expression: foo
In the expression: proc x -> case x of { Bar a -> foo -< a }
In an equation for `get':
get = proc x -> case x of { Bar a -> foo -< a }
module T7237 where
import Data.List (foldl')
data SPair = SPair { pX, pY :: Double } deriving (Eq,Show)
data AList = AList { pairs :: [SPair] } deriving Show
rnf' :: AList -> ()
rnf' aList = foldl' (flip seq) () (pairs aList) `seq` ()
......@@ -20,3 +20,4 @@ test('massive_array',
[ if_arch('i386', expect_broken(7213)),
if_arch('i386', omit_ways(['llvm', 'optllvm'])) ],
compile, ['-fPIC'])
test('T7237', normal, compile, [''])
{-# LANGUAGE MagicHash #-}
import Control.Concurrent
import qualified Data.Vector as U
main = do
t <- forkIO (U.sum (U.enumFromTo 1 (1000000000 :: Int)) `seq` return ())
threadDelay 10
killThread t
putStrLn "Done"
{-# LANGUAGE MagicHash #-}
-- Should be compiled with -O0
import Control.Concurrent
import GHC.Conc
import GHC.Prim
import GHC.Exts
main = do
t <- forkIO (f 0 `seq` return ())
threadDelay 10
killThread t
putStrLn "Done"
-- Non-allocating let-no-escape infinite loop in fail
{-# NOINLINE f #-}
f :: Int -> Bool
f i@(I# j) = let fail :: Int# -> Bool
fail i = fail (i +# 1#)
in if (case i of
0 -> True
_ -> False) then fail j else False
......@@ -21,6 +21,10 @@ test('conc071', omit_ways(['threaded2']), compile_and_run, [''])
test('conc072', only_ways(['threaded2']), compile_and_run, [''])
test('conc073', normal, compile_and_run, [''])
# vector code must get inlined to become non-allocating
test('367', composes([reqlib('vector'), timeout_multiplier(0.001)]), compile_and_run, ['-O2 -fno-omit-yields'])
test('367_letnoescape', composes([timeout_multiplier(0.001)]), compile_and_run, ['-fno-omit-yields'])
test('1980', normal, compile_and_run, [''])
test('2910', normal, compile_and_run, [''])
test('2910a', normal, compile_and_run, [''])
......
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
T5252:
$(RM) -f T5252*.hi T5252*.o
'$(TEST_HC)' $(TEST_HC_OPTS) -c T5252a.hs
'$(TEST_HC)' $(TEST_HC_OPTS) -c T5252.hs
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
T5252:
$(RM) -f T5252*.hi T5252*.o
'$(TEST_HC)' $(TEST_HC_OPTS) -c T5252a.hs
'$(TEST_HC)' $(TEST_HC_OPTS) -c T5252.hs
# Failed when compiled *without* optimisation
T5252Take2:
$(RM) -f T5252*.hi T5252*.o
'$(TEST_HC)' $(TEST_HC_OPTS) -c T5252Take2a.hs
'$(TEST_HC)' $(TEST_HC_OPTS) -c T5252Take2.hs
module T5252Take2 where
import qualified T5252Take2a as M
write_message :: M.WriteMessage -> IO Bool
write_message (M.WriteMessage _) = return True
{-# OPTIONS_GHC -funbox-strict-fields #-}
module T5252Take2a ( WriteMessage(..) , WriteDevice ) where
import qualified Data.ByteString as ByteString
data WriteMessage = WriteMessage !WriteDevice
newtype WriteDevice = WriteDevice ByteString.ByteString
......@@ -95,3 +95,9 @@ test('T5001',
extra_clean(['T5001a.hi', 'T5001a.o'])],
multimod_compile,
['T5001', '-v0'])
# T5252Take2 failed when compiled *wihtout* optimisation
test('T5252Take2',
extra_clean(['T5252Take2a.hi', 'T5252Take2a.o']),
run_command,
['$MAKE -s --no-print-directory T5252Take2'])
......@@ -3,7 +3,6 @@ T2851.hs:9:15:
No instance for (Show (F a))
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Show (F a))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Show (D a))
......@@ -3,7 +3,6 @@ T3621.hs:21:21:
No instance for (MonadState state (State s))
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (MonadState state (State s))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (MonadState state (WrappedState s))
......@@ -4,5 +4,6 @@ class A a oops
data D d = D d
instance A a oops => Read (D a)
data E e = E (D e) deriving Read
instance A Int Bool
......@@ -2,6 +2,10 @@
T5287.hs:6:29:
No instance for (A e oops)
arising from the 'deriving' clause of a data type declaration
The type variable `oops' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there is a potential instance available:
instance A Int Bool -- Defined at T5287.hs:7:10
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
......
drvfail-foldable-traversable1.hs:9:23:
No instance for (Functor Trivial1)
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Functor Trivial1)
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Traversable Trivial1)
drvfail-foldable-traversable1.hs:13:22:
No instance for (Foldable Trivial2)
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Foldable Trivial2)
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Traversable Trivial2)
drvfail-foldable-traversable1.hs:17:22:
Can't make a derived instance of `Foldable Infinite':
Constructor `Infinite' must not contain function types
In the data declaration for `Infinite'
drvfail-foldable-traversable1.hs:21:22:
Can't make a derived instance of `Traversable (Cont r)':
Constructor `Cont' must not contain function types
In the data declaration for `Cont'
drvfail-foldable-traversable1.hs:9:23:
No instance for (Functor Trivial1)
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Traversable Trivial1)
drvfail-foldable-traversable1.hs:13:22:
No instance for (Foldable Trivial2)
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Traversable Trivial2)
drvfail-foldable-traversable1.hs:17:22:
Can't make a derived instance of `Foldable Infinite':
Constructor `Infinite' must not contain function types
In the data declaration for `Infinite'
drvfail-foldable-traversable1.hs:21:22:
Can't make a derived instance of `Traversable (Cont r)':
Constructor `Cont' must not contain function types
In the data declaration for `Cont'
drvfail-functor2.hs:1:29: Warning:
-XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
drvfail-functor2.hs:7:14:
Can't make a derived instance of `Functor InFunctionArgument':
Constructor `InFunctionArgument' must not use the type variable in a function argument
In the newtype declaration for `InFunctionArgument'
drvfail-functor2.hs:10:14:
Can't make a derived instance of `Functor OnSecondArg':
Constructor `OnSecondArg' must use the type variable only as the last argument of a data type
In the newtype declaration for `OnSecondArg'
drvfail-functor2.hs:15:14:
Cannot derive well-kinded instance of form `Functor (NoArguments ...)'
Class `Functor' expects an argument of kind `* -> *'
In the newtype declaration for `NoArguments'
drvfail-functor2.hs:20:14:
Can't make a derived instance of `Functor StupidConstraint':
Data type `StupidConstraint' must not have a class context (Eq a)
In the data declaration for `StupidConstraint'
drvfail-functor2.hs:26:14:
No instance for (Functor NoFunctor)
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Functor NoFunctor)
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Functor UseNoFunctor)
drvfail-functor2.hs:1:29: Warning:
-XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
drvfail-functor2.hs:7:14:
Can't make a derived instance of `Functor InFunctionArgument':
Constructor `InFunctionArgument' must not use the type variable in a function argument
In the newtype declaration for `InFunctionArgument'
drvfail-functor2.hs:10:14:
Can't make a derived instance of `Functor OnSecondArg':
Constructor `OnSecondArg' must use the type variable only as the last argument of a data type
In the newtype declaration for `OnSecondArg'
drvfail-functor2.hs:15:14:
Cannot derive well-kinded instance of form `Functor (NoArguments ...)'
Class `Functor' expects an argument of kind `* -> *'
In the newtype declaration for `NoArguments'
drvfail-functor2.hs:20:14:
Can't make a derived instance of `Functor StupidConstraint':
Data type `StupidConstraint' must not have a class context (Eq a)
In the data declaration for `StupidConstraint'
drvfail-functor2.hs:26:14:
No instance for (Functor NoFunctor)
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Functor UseNoFunctor)
......@@ -3,7 +3,6 @@ drvfail001.hs:16:33:
No instance for (Show (f (f a)))
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Show (f (f a)))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Show (SM f a))
......@@ -3,7 +3,6 @@ drvfail002.hs:19:23:
No instance for (X T c)
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (X T c)
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Show S)
......@@ -3,7 +3,6 @@ drvfail003.hs:16:56:
No instance for (Show (v (v a)))
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Show (v (v a)))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Show (Square_ v w a))
......@@ -3,7 +3,6 @@ drvfail004.hs:8:12:
No instance for (Eq (Foo a b))
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Eq (Foo a b))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Ord (Foo a b))
......@@ -3,7 +3,6 @@ drvfail007.hs:4:38:
No instance for (Eq (Int -> Int))
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Eq (Int -> Int))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Eq Foo)
......@@ -3,7 +3,6 @@ drvfail012.hs:5:33:
No instance for (Eq (Ego a))
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Eq (Ego a))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Ord (Ego a))
......@@ -3,16 +3,14 @@ drvfail013.hs:4:70:
No instance for (Eq (m (Maybe a)))
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Eq (m (Maybe a)))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Eq (MaybeT m a))
drvfail013.hs:6:70:
No instance for (Eq (m (Maybe a)))
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (Eq (m (Maybe a)))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Eq (MaybeT' m a))
......@@ -45,7 +45,8 @@ expectedGhcOnlyExtensions = ["ParallelArrays",
"InstanceSigs",
"CApiFFI",
"LambdaCase",
"MultiWayIf"]
"MultiWayIf",
"TypeHoles"]
expectedCabalOnlyExtensions :: [String]
expectedCabalOnlyExtensions = ["Generics",
......