Commit 57938f3e authored by dterei's avatar dterei

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

parents 001455ac 610c0e65
......@@ -20,10 +20,17 @@ main :: IO ()
main = do
newStablePtr stdout -- prevent stdout being finalized
th <- newEmptyMVar
tid <- forkIO $ do
putStrLn "newThread started"
(sleep 2 >> putStrLn "fail") `catch` (\ThreadKilled -> putStrLn "pass")
putMVar th "child"
-- if the killThread below gets blocked for more than a second, then
-- this thread will kill the main thread and the test will fail.
main <- myThreadId
forkIO $ do threadDelay 1000000; throwTo main (ErrorCall "still waiting")
yield
threadDelay 500000
killThread tid
......
......@@ -9,8 +9,8 @@ T3807:
$(RM) T3807-export.o T3807-load.o
$(RM) T3807test.so
$(RM) T3807-load
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make -dynamic -fPIC -shared T3807Export.hs T3807-export.c -o T3807test.so -lHSrts-ghc`'$(TEST_HC)' $(TEST_HC_OPTS) --numeric-version`
'$(TEST_HC)' $(TEST_HC_OPTS) T3807-load.c -o T3807-load -ldl
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make -dynamic -fPIC -shared T3807Export.hs T3807-export.c -o T3807test.so -lHSrts-ghc`'$(TEST_HC)' $(TEST_HC_OPTS) --numeric-version` -rtsopts
'$(TEST_HC)' $(TEST_HC_OPTS) -no-auto-link-packages -no-hs-main T3807-load.c -o T3807-load -ldl
./T3807-load
.PHONY: T4464
......@@ -30,3 +30,14 @@ T4464:
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe
./t4464.exe
.PHONY: T5373
T5373:
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -dynamic --make T5373A
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -dynamic --make T5373B -rtsopts
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -dynamic --make T5373C -rtsopts=some
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -dynamic --make T5373D -rtsopts=none
-./T5373A +RTS -\? 2>&1 | grep disabled
-./T5373B +RTS -\? 2>&1 | grep disabled
-./T5373C +RTS -\? 2>&1 | grep disabled
-./T5373D +RTS -\? 2>&1 | grep disabled
T5373A: Most RTS options are disabled. Link with -rtsopts to enable them.
T5373C: Most RTS options are disabled. Link with -rtsopts to enable them.
T5373D: RTS options are disabled. Link with -rtsopts to enable them.
main :: IO ()
main = return ()
main :: IO ()
main = return ()
main :: IO ()
main = return ()
main :: IO ()
main = return ()
......@@ -6,8 +6,7 @@ test('T3807',
'T3807-export.o', 'T3807-load.o',
'T3807test.so',
'T3807-load']),
if_os('mingw32', skip),
if_os('darwin', expect_broken(4264))],
if_os('mingw32', skip)],
run_command,
['$MAKE --no-print-directory -s T3807'])
......@@ -19,3 +18,13 @@ test('T4464',
run_command,
['$MAKE --no-print-directory -s T4464'])
test('T5373',
[extra_clean(['T5373A.hi', 'T5373B.hi', 'T5373C.hi', 'T5373D.hi',
'T5373A.o', 'T5373B.o', 'T5373C.o', 'T5373D.o',
'T5373A', 'T5373B', 'T5373C', 'T5373D',
'T5373A.exe', 'T5373B.exe', 'T5373C.exe', 'T5373D.exe']),
if_os('mingw32', expect_broken(5373)),
if_os('darwin', expect_broken(5373))],
run_command,
['$MAKE --no-print-directory -s T5373'])
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -ddump-deriv #-}
module GenDerivOutput where
import GHC.Generics (Generic)
data List a = Nil | Cons { element :: a, rest :: List a } deriving Generic
==================== Derived instances ====================
Derived instances:
instance GHC.Generics.Generic (GenDerivOutput.List a) where
GHC.Generics.from GenDerivOutput.Nil
= GHC.Generics.M1
(GHC.Generics.L1 (GHC.Generics.M1 GHC.Generics.U1))
GHC.Generics.from (GenDerivOutput.Cons g1 g2)
= GHC.Generics.M1
(GHC.Generics.R1
(GHC.Generics.M1
((GHC.Generics.:*:)
(GHC.Generics.M1 (GHC.Generics.K1 g1))
(GHC.Generics.M1 (GHC.Generics.K1 g2)))))
GHC.Generics.to
(GHC.Generics.M1 (GHC.Generics.L1 (GHC.Generics.M1 GHC.Generics.U1)))
= GenDerivOutput.Nil
GHC.Generics.to
(GHC.Generics.M1 (GHC.Generics.R1 (GHC.Generics.M1 (GHC.Generics.:*: (GHC.Generics.M1 (GHC.Generics.K1 g1))
(GHC.Generics.M1 (GHC.Generics.K1 g2))))))
= GenDerivOutput.Cons g1 g2
instance GHC.Generics.Datatype GenDerivOutput.D1List where
GHC.Generics.datatypeName _ = "List"
GHC.Generics.moduleName _ = "GenDerivOutput"
instance GHC.Generics.Constructor GenDerivOutput.C1_0List where
GHC.Generics.conName _ = "Nil"
instance GHC.Generics.Constructor GenDerivOutput.C1_1List where
GHC.Generics.conName _ = "Cons"
GHC.Generics.conIsRecord _ = GHC.Types.True
instance GHC.Generics.Selector GenDerivOutput.S1_1_0List where
GHC.Generics.selName _ = "element"
instance GHC.Generics.Selector GenDerivOutput.S1_1_1List where
GHC.Generics.selName _ = "rest"
Generic representation:
Generated datatypes for meta-information:
GenDerivOutput.D1List
GenDerivOutput.C1_0List
GenDerivOutput.C1_1List
GenDerivOutput.S1_1_0List
GenDerivOutput.S1_1_1List
Representation types: GenDerivOutput.Rep_List
Meta-information instances:
instance GHC.Generics.Datatype GenDerivOutput.D1List where
GHC.Generics.datatypeName _ = "List"
GHC.Generics.moduleName _ = "GenDerivOutput"
instance GHC.Generics.Constructor GenDerivOutput.C1_0List where
GHC.Generics.conName _ = "Nil"
instance GHC.Generics.Constructor GenDerivOutput.C1_1List where
GHC.Generics.conName _ = "Cons"
GHC.Generics.conIsRecord _ = GHC.Types.True
instance GHC.Generics.Selector GenDerivOutput.S1_1_0List where
GHC.Generics.selName _ = "element"
instance GHC.Generics.Selector GenDerivOutput.S1_1_1List where
GHC.Generics.selName _ = "rest"
setTestOpts(only_compiler_types(['ghc']))
test('GenCanDoRep0', normal, compile, [''])
test('GenDerivOutput', normal, compile, ['-dsuppress-uniques'])
test('GenShouldFail0', normal, compile_fail, [''])
test('GenCannotDoRep0', normal, compile_fail, [''])
......
-- load into ghci
"λa: (Type[0] → (Type[0] → Type[0])).\
λb: (Type[0] → Type[0]). λc: Type[0].\
((a c)(b c))"
T5425.hs:5:2:
lexical error in string/character literal at character '\955'
......@@ -73,3 +73,4 @@ test('readFailTraditionalRecords1', normal, compile_fail, [''])
test('readFailTraditionalRecords2', normal, compile_fail, [''])
test('readFailTraditionalRecords3', normal, compile_fail, [''])
test('T5425', normal, compile_fail, [''])
......@@ -53,7 +53,7 @@ test('T3294',
[if_wordsize(32,
compiler_stats_num_field('max_bytes_used', 15000000,
20000000)),
# expected value: 13049060 (x86/Linux)
# expected value: 17725476 (x86/OS X)
if_wordsize(64,
compiler_stats_num_field('max_bytes_used', 26000000,
37000000)),
......@@ -87,10 +87,10 @@ test('T4801',
# expected value: 64 (amd64/OS X):
if_platform('x86_64-apple-darwin',
compiler_stats_num_field('peak_megabytes_allocated', 62, 66)),
# expected value: 353463196 (x86/Windows)
# expected value: 228286660 (x86/OS X)
if_wordsize(32,
compiler_stats_num_field('bytes allocated', 330000000,
370000000)),
compiler_stats_num_field('bytes allocated', 200000000,
240000000)),
# expected value: 458700632 (amd64/Linux):
if_wordsize(64,
compiler_stats_num_field('bytes allocated', 440000000,
......
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