Commit 26c4300a authored by dterei's avatar dterei
Browse files

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

parents d02b4bf1 9107d827
......@@ -8,9 +8,13 @@
*.orig
*.prof
*.exe
*.hi
*.o
*.pyc
*.normalised
*.eventlog
*.comp.std*
# -----------------------------------------------------------------------------
# specific generated files
......@@ -82,3 +86,4 @@ tests/ghc-regress/th/TH_import_loop/ModuleA.o-boot
tests/ghc-regress/typecheck/should_fail/T3468.o-boot
timeout/calibrate.out
timeout/install-inplace/
timeout/dist/
......@@ -6,8 +6,8 @@ T2111.hs:6:23:
The arrow command
undefined -< x
was found where an expression was expected
In a stmt of a 'do' expression: x <- undefined -< x
In a stmt of a 'do' expression: rec {x <- undefined -< x}
In a stmt of a 'do' block: x <- undefined -< x
In a stmt of a 'do' block: rec {x <- undefined -< x}
In the expression:
do { rec {x <- undefined -< x};
undefined -< x }
......@@ -24,7 +24,7 @@ cabal01:
'$(TEST_HC)' --make -o setup Setup.lhs -v0
'$(GHC_PKG)' init local.db
./setup configure -v0 --prefix=$(PREFIX) --with-compiler='$(TEST_HC)' --with-hc-pkg='$(GHC_PKG)' --package-db=local.db $(PROF)
./setup configure -v0 --prefix=$(PREFIX) --with-compiler='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --with-hc-pkg='$(GHC_PKG)' --package-db=local.db $(PROF)
./setup build -v0
./setup copy -v0
echo install1:
......
......@@ -4,7 +4,7 @@ include $(TOP)/mk/test.mk
CABAL_SETUP = $(FPTOOLS_TOP_ABS)/libraries/Cabal/cabal-setup/cabal-setup
CONFIG_ARGS = --with-compiler=$(TEST_HC) --with-hc-pkg=$(GHC_PKG)
CONFIG_ARGS = --with-compiler=$(TEST_HC) --ghc-options='$(TEST_HC_OPTS)' --with-hc-pkg=$(GHC_PKG)
# We have 3 packages, P-1.0, P-2.0, and Q. Q depends on P-1.0.
# We have an executable R, that depends on P-2.0 and Q, so the resulting
......
......@@ -20,17 +20,17 @@ cabal03: clean
'$(GHC_PKG)' init tmp.d
'$(TEST_HC)' -v0 --make Setup
cd p && $(SETUP) clean
cd p && $(SETUP) configure --with-ghc='$(TEST_HC)' --package-db=../tmp.d --disable-optimisation --ghc-pkg-option=--force
cd p && $(SETUP) configure --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --disable-optimisation --ghc-pkg-option=--force
cd p && $(SETUP) build
cd p && $(SETUP) register
cd q && $(SETUP) configure --with-ghc='$(TEST_HC)' --package-db=../tmp.d --ghc-pkg-option=--force
cd q && $(SETUP) configure --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
cd q && $(SETUP) build
cd q && $(SETUP) register
cd p && $(SETUP) clean
cd p && $(SETUP) configure --with-ghc='$(TEST_HC)' --package-db=../tmp.d --ghc-pkg-option=--force
cd p && $(SETUP) configure --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
cd p && $(SETUP) build
cd p && $(SETUP) register
cd r && ! ../Setup configure --with-ghc='$(TEST_HC)' --package-db=../tmp.d --ghc-pkg-option=--force
cd r && ! ../Setup configure --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
ifneq "$(CLEANUP)" ""
$(MAKE) clean
endif
......
......@@ -11,7 +11,7 @@ cabal04:
$(MAKE) clean
'$(TEST_HC)' -v0 --make Setup
$(SETUP) clean
$(SETUP) configure --with-ghc='$(TEST_HC)' $(PROF) $(DYN)
$(SETUP) configure --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' $(PROF) $(DYN)
$(SETUP) build 2> err
! grep -v "Creating library file" err
ifneq "$(CLEANUP)" ""
......
{-# LANGUAGE OverloadedStrings #-}
module BadWarning where
data MyString = MyString String
f1 (MyString "a") = undefined
f1 (MyString "bb") = undefined
f1 _ = undefined
f2 (MyString "aa") = undefined
f2 (MyString "bb") = undefined
f2 _ = undefined
-- Genuine overlap here!
f3(MyString ('a':_)) = undefined
f3 (MyString "a") = undefined
f3 _ = undefined
T5117.hs:15:1:
Warning: Pattern match(es) are overlapped
In an equation for `f3': f3 (MyString "a") = ...
......@@ -83,3 +83,4 @@ test('T4870',
extra_clean(['T4870a.hi', 'T4870a.o'])],
multimod_compile,
['T4870', '-v0'])
test('T5117', normal, compile, [''])
......@@ -29,3 +29,11 @@ test('dsrun023', normal, compile_and_run, [''])
test('T246', normal, compile_and_run, [''])
test('T3126', normal, compile_and_run, [''])
test('T3382', normal, compile_and_run, [''])
test('mc01', expect_broken_for(4370, ['ghci','hpc']), compile_and_run, [''])
test('mc02', normal, compile_and_run, [''])
test('mc03', normal, compile_and_run, [''])
test('mc04', normal, compile_and_run, [''])
test('mc05', normal, compile_and_run, [''])
test('mc06', expect_broken_for(4370, ['ghci','hpc']), compile_and_run, [''])
test('mc07', normal, compile_and_run, [''])
test('mc08', expect_broken_for(4370, ['ghci','hpc']), compile_and_run, [''])
-- Transformation stress test
{-# OPTIONS_GHC -XTransformListComp #-}
module Main where
import Data.List(takeWhile)
import GHC.Exts(sortWith)
employees = [ ("Simon", "MS", 80)
, ("Erik", "MS", 100)
, ("Phil", "Ed", 40)
, ("Gordon", "Ed", 45)
, ("Paul", "Yale", 60)]
main = putStrLn (show output)
where
output = [ (dept, salary)
| then sortWith by 1
, (name, dept, salary) <- employees
, then sortWith by salary
, then filter by salary > 50
-- Transformation stress test
{-# OPTIONS_GHC -XTransformListComp #-}
module Main where
import Data.List(takeWhile)
import GHC.Exts(sortWith)
employees = [ ("Simon", "MS", 80)
, ("Erik", "MS", 100)
, ("Phil", "Ed", 40)
, ("Gordon", "Ed", 45)
, ("Paul", "Yale", 60)]
main = putStrLn (show output)
where
output = [ (dept, salary)
| (name, dept, salary) <- employees
, then sortWith by salary
, then filter by salary > 50
, then take 1 ]
\ No newline at end of file
-- Transformation and grouping stress test
{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}
module Main where
import GHC.Exts(sortWith, the)
employees = [ ("Simon", "MS", 80)
, ("Erik", "MS", 100)
, ("Phil", "Ed", 40)
, ("Gordon", "Ed", 45)
, ("Paul", "Yale", 60) ]
main = putStrLn (show can_still_use_group_function) >> putStrLn (show output)
where
output = [ (the dept, map sum salary, (show x) ++ " and " ++ (show y))
| (name, dept, salary) <- employees
, then group by dept
, x <- [1, 2, 3]
, y <- [4, 5, 6]
, then sortWith by sum salary
, then take 4
, then group using replicate 2 ]
group = const "my group function called!"
can_still_use_group_function = group "Mississippi"
"my group function called!"
[(["Yale"],[60,60,60,60],"[1,1,1,2] and [4,5,6,4]"),(["Yale"],[60,60,60,60],"[1,1,1,2] and [4,5,6,4]")]
-- Transformation stress test
{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}
module Main where
import Data.List(takeWhile)
import GHC.Exts(sortWith)
employees = [ ("Simon", "MS", 80)
, ("Erik", "MS", 100)
, ("Phil", "Ed", 40)
, ("Gordon", "Ed", 45)
, ("Paul", "Yale", 60)]
main = putStrLn (show output)
where
output = [ (dept, salary)
| (name, dept, salary) <- employees
, then sortWith by salary
, then filter by salary > 50
, then take 1 ]
-- "Big tuple" stress test for monad comprehensions
{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp -XParallelListComp #-}
module Main where
main = putStrLn (show output)
where
output = [ x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 +
x20 + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29 +
x30 + x31 + x32 + x33 + x34 + x35 + x36 + x37 + x38 + x39 +
x40 + x41 + x42 + x43 + x44 + x45 + x46 + x47 + x48 + x49 +
x50 + x51 + x52 + x53 + x54 + x55 + x56 + x57 + x58 + x59 +
x60 + x61 + x62 + x63 + x64 + x65 + x66 + x67 + x68 + x69 +
x70 + x71 + x72 + x73 + x74 + x75 + x76 + x77 + x78 + x79 +
x80 + x81 + x82 + x83 + x84 + x85 + x86 + x87 + x88 + x89 +
x90 + x91 + x92 + x93 + x94 + x95 + x96 + x97 + x98 + x99 +
y
| x0 <- [0], x1 <- [1], x2 <- [2], x3 <- [3], x4 <- [4]
, x5 <- [5], x6 <- [6], x7 <- [7], x8 <- [8], x9 <- [9]
, x10 <- [0], x11 <- [1], x12 <- [2], x13 <- [3], x14 <- [4]
, x15 <- [5], x16 <- [6], x17 <- [7], x18 <- [8], x19 <- [9]
, x20 <- [0], x21 <- [1], x22 <- [2], x23 <- [3], x24 <- [4]
, x25 <- [5], x26 <- [6], x27 <- [7], x28 <- [8], x29 <- [9]
, x30 <- [0], x31 <- [1], x32 <- [2], x33 <- [3], x34 <- [4]
, x35 <- [5], x36 <- [6], x37 <- [7], x38 <- [8], x39 <- [9]
, x40 <- [0], x41 <- [1], x42 <- [2], x43 <- [3], x44 <- [4]
, x45 <- [5], x46 <- [6], x47 <- [7], x48 <- [8], x49 <- [9]
, x50 <- [0], x51 <- [1], x52 <- [2], x53 <- [3], x54 <- [4]
, x55 <- [5], x56 <- [6], x57 <- [7], x58 <- [8], x59 <- [9]
, x60 <- [0], x61 <- [1], x62 <- [2], x63 <- [3], x64 <- [4]
, x65 <- [5], x66 <- [6], x67 <- [7], x68 <- [8], x69 <- [9]
, x70 <- [0], x71 <- [1], x72 <- [2], x73 <- [3], x74 <- [4]
, x75 <- [5], x76 <- [6], x77 <- [7], x78 <- [8], x79 <- [9]
, x80 <- [0], x81 <- [1], x82 <- [2], x83 <- [3], x84 <- [4]
, x85 <- [5], x86 <- [6], x87 <- [7], x88 <- [8], x89 <- [9]
, x90 <- [0], x91 <- [1], x92 <- [2], x93 <- [3], x94 <- [4]
, x95 <- [5], x96 <- [6], x97 <- [7], x98 <- [8], x99 <- [9]
, then take 4
| y <- [10] ]
-- Tests grouping WITH a using clause but WITHOUT a by clause
{-# OPTIONS_GHC -XTransformListComp #-}
module Main where
import Data.List(inits)
main = putStrLn (show output)
where
output = [ x
| y <- [1..3]
, x <- "hello"
, then group using inits ]
["","h","he","hel","hell","hello","helloh","hellohe","hellohel","hellohell","hellohello","hellohelloh","hellohellohe","hellohellohel","hellohellohell","hellohellohello"]
-- Test transform WITHOUT a by clause
{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}
module Main where
main = putStrLn (show output)
where
output = [ x
| x <- [1..10]
, then take 5 ]
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