summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-06-27 21:53:39 +0100
committerIan Lynagh <igloo@earth.li>2012-06-27 21:53:39 +0100
commitaa490c9cd6b5849f9ed1512955516f19a30e62d3 (patch)
treedd7fc117d71cc94577791fda515866348155696b /testsuite
parent71bb78003d58b8b95abba85b505f1bc82a0311cc (diff)
parente2777978c9a65fb35a9e91038f98244ddd7c6890 (diff)
downloadhaskell-aa490c9cd6b5849f9ed1512955516f19a30e62d3.tar.gz
Merge branch 'master' of darcs.haskell.org:/srv/darcs//testsuite
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/codeGen/should_run/T5900.hs25
-rw-r--r--testsuite/tests/codeGen/should_run/T5900.stderr1
-rw-r--r--testsuite/tests/codeGen/should_run/T5900.stdout1
-rw-r--r--testsuite/tests/codeGen/should_run/all.T2
-rw-r--r--testsuite/tests/plugins/simple-plugin/Makefile3
-rw-r--r--testsuite/tests/quasiquotation/T4491/test.T3
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T2
-rw-r--r--testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.hs (renamed from testsuite/tests/typecheck/should_compile/SilentParametersOverlapping.hs)4
-rw-r--r--testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.stderr13
-rw-r--r--testsuite/tests/typecheck/should_fail/T5051.hs (renamed from testsuite/tests/typecheck/should_compile/T5051.hs)1
-rw-r--r--testsuite/tests/typecheck/should_fail/T5051.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/T5691.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail019.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail041.stderr7
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail042.stderr15
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail106.stderr6
17 files changed, 61 insertions, 47 deletions
diff --git a/testsuite/tests/codeGen/should_run/T5900.hs b/testsuite/tests/codeGen/should_run/T5900.hs
new file mode 100644
index 0000000000..231edeba2c
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T5900.hs
@@ -0,0 +1,25 @@
+import Data.Bits
+import Data.Word
+import Debug.Trace
+
+fl :: Word64 -> Word64 -> Word64
+fl fin sk =
+ let (x1, x2) = w64tow32 fin in
+ let (k1, k2) = w64tow32 sk in
+ let y2 = x2 `xor` ((x1 .&. k1) `rotateL` 1) in
+ let y1 = x1 `xor` (y2 .|. k2) in
+ trace (show fin ++ " " ++ show sk ++ " -> " ++ show (w32tow64 (y1, y2))) $ w32tow64 (y1, y2)
+
+w64tow32 :: Word64 -> (Word32, Word32)
+w64tow32 w = (fromIntegral (w `shiftR` 32), fromIntegral (w .&. 0xffffffff))
+
+w32tow64 :: (Word32, Word32) -> Word64
+w32tow64 (x1, x2) = ((fromIntegral x1) `shiftL` 32) .|. (fromIntegral x2)
+
+a, b :: Word64
+a = 1238988323332265734
+b = 11185553392205053542
+
+main :: IO ()
+main =
+ putStrLn $ "fl " ++ show a ++ " " ++ show b ++ " -> " ++ show (fl a b)
diff --git a/testsuite/tests/codeGen/should_run/T5900.stderr b/testsuite/tests/codeGen/should_run/T5900.stderr
new file mode 100644
index 0000000000..edea8b8b6c
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T5900.stderr
@@ -0,0 +1 @@
+1238988323332265734 11185553392205053542 -> 18360184157246690566
diff --git a/testsuite/tests/codeGen/should_run/T5900.stdout b/testsuite/tests/codeGen/should_run/T5900.stdout
new file mode 100644
index 0000000000..f422ff92cc
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T5900.stdout
@@ -0,0 +1 @@
+fl 1238988323332265734 11185553392205053542 -> 18360184157246690566
diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T
index 272eb4ac48..c03ea502d1 100644
--- a/testsuite/tests/codeGen/should_run/all.T
+++ b/testsuite/tests/codeGen/should_run/all.T
@@ -92,4 +92,4 @@ test('5785', normal, compile_and_run, [''])
test('setByteArray', normal, compile_and_run, [''])
test('6146', normal, compile_and_run, [''])
-
+test('T5900', normal, compile_and_run, [''])
diff --git a/testsuite/tests/plugins/simple-plugin/Makefile b/testsuite/tests/plugins/simple-plugin/Makefile
index 73a7e33842..5bbac56aaf 100644
--- a/testsuite/tests/plugins/simple-plugin/Makefile
+++ b/testsuite/tests/plugins/simple-plugin/Makefile
@@ -6,10 +6,11 @@ LOCAL_PKGCONF=local.package.conf
PKG_NAME=simple-plugin
clean:
- rm setup
+ rm -f setup
rm -f $(LOCAL_PKGCONF)
rm -rf dist
rm -rf install
+ rm -f Setup.hi Setup.o
PREFIX := $(abspath install)
$(eval $(call canonicalise,PREFIX))
diff --git a/testsuite/tests/quasiquotation/T4491/test.T b/testsuite/tests/quasiquotation/T4491/test.T
index 7d023883dc..b62370aaef 100644
--- a/testsuite/tests/quasiquotation/T4491/test.T
+++ b/testsuite/tests/quasiquotation/T4491/test.T
@@ -5,6 +5,7 @@ test('T4491',
# in the prof or dyn ways, due to the TH use, so for now we just
# omit the other ways
omit_ways(['profasm','profthreaded','dyn']),
- only_compiler_types(['ghc'])
+ only_compiler_types(['ghc']),
+ extra_clean(['A.hi', 'A.o'])
],
compile_and_run, [''])
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 86f0e7414c..5a0e36efec 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -355,9 +355,7 @@ test('tc260', normal, compile, [''])
test('tc261', normal, compile, [''])
test('GivenOverlapping', normal, compile, [''])
-test('SilentParametersOverlapping', normal, compile, [''])
test('GivenTypeSynonym', normal, compile, [''])
-test('T5051', normal, compile, [''])
test('T3018', normal, compile, [''])
test('T5032', normal, compile, [''])
test('T2357', normal, compile, [''])
diff --git a/testsuite/tests/typecheck/should_compile/SilentParametersOverlapping.hs b/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.hs
index 8169c3f64a..44ba7039d9 100644
--- a/testsuite/tests/typecheck/should_compile/SilentParametersOverlapping.hs
+++ b/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.hs
@@ -15,5 +15,5 @@ instance {- silent: C [(a,b)] => -} B [(a,b)] where
b x = c [(undefined,undefined)]
-- We get wanted: C [(gamma, delta)],
-- and gamma,delta are unconstrained
- -- But we can apply the C [a] instance without difficulty
- -- (except in the old days when we had silent dfun parameters)
+ -- We can apply the C [a] instance without difficulty, but
+ -- that fails due to silent dfun parameters
diff --git a/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.stderr b/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.stderr
new file mode 100644
index 0000000000..6a49325e43
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.stderr
@@ -0,0 +1,13 @@
+
+SilentParametersOverlapping.hs:15:9:
+ Overlapping instances for C [(t0, t1)] arising from a use of `c'
+ Matching givens (or their superclasses):
+ (C [(a, b)])
+ bound by the instance declaration
+ at SilentParametersOverlapping.hs:14:37-45
+ Matching instances:
+ instance C [a] -- Defined at SilentParametersOverlapping.hs:11:10
+ (The choice depends on the instantiation of `t0, t1')
+ In the expression: c [(undefined, undefined)]
+ In an equation for `b': b x = c [(undefined, undefined)]
+ In the instance declaration for `B [(a, b)]'
diff --git a/testsuite/tests/typecheck/should_compile/T5051.hs b/testsuite/tests/typecheck/should_fail/T5051.hs
index e98c074c4b..6c5faf9170 100644
--- a/testsuite/tests/typecheck/should_compile/T5051.hs
+++ b/testsuite/tests/typecheck/should_fail/T5051.hs
@@ -31,3 +31,4 @@ foo x = x >= x
-- This is terribly confusing: the use of (>=) means we need Ord [a],
-- and if we have Ord a (which we do) we should be done.
-- A very good reason for not having silent parameters!
+-- But, alas, we need them!
diff --git a/testsuite/tests/typecheck/should_fail/T5051.stderr b/testsuite/tests/typecheck/should_fail/T5051.stderr
new file mode 100644
index 0000000000..cebde5c29f
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T5051.stderr
@@ -0,0 +1,11 @@
+
+T5051.hs:11:11:
+ Overlapping instances for Eq [a] arising from a use of `>='
+ Matching instances:
+ instance Eq a => Eq [a] -- Defined in `GHC.Classes'
+ instance [overlap ok] Eq [T] -- Defined at T5051.hs:8:10
+ (The choice depends on the instantiation of `a'
+ To pick the first instance above, use -XIncoherentInstances
+ when compiling the other instance declarations)
+ In the expression: x >= x
+ In an equation for `foo': foo x = x >= x
diff --git a/testsuite/tests/typecheck/should_fail/T5691.stderr b/testsuite/tests/typecheck/should_fail/T5691.stderr
index 0102aef55a..4e2974485c 100644
--- a/testsuite/tests/typecheck/should_fail/T5691.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5691.stderr
@@ -6,9 +6,3 @@ T5691.hs:14:9:
In the pattern: f :: p a
In an equation for `test': test (f :: p a) = MkPRI $ printRule_ f
In the instance declaration for `Test PrintRuleInterp'
-
-T5691.hs:24:10:
- No instance for (Monad RecDecParser)
- arising from the superclasses of an instance declaration
- Possible fix: add an instance declaration for (Monad RecDecParser)
- In the instance declaration for `MonadPlus RecDecParser'
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 404d868333..daf0f270f4 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -243,8 +243,10 @@ test('tcfail215', normal, compile_fail, [''])
test('tcfail216', normal, compile_fail, [''])
test('tcfail217', normal, compile_fail, [''])
+test('SilentParametersOverlapping', normal, compile_fail, [''])
test('FailDueToGivenOverlapping', normal, compile_fail, [''])
test('LongWayOverlapping', normal, compile_fail, [''])
+test('T5051', normal, compile_fail, [''])
test('T5236',normal,compile_fail,[''])
test('T5246',normal,compile_fail,[''])
test('T5300',normal,compile_fail,[''])
diff --git a/testsuite/tests/typecheck/should_fail/tcfail019.stderr b/testsuite/tests/typecheck/should_fail/tcfail019.stderr
index 0f24d012f6..ac2178be97 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail019.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail019.stderr
@@ -4,9 +4,3 @@ tcfail019.hs:18:10:
arising from the superclasses of an instance declaration
Possible fix: add an instance declaration for (B [a])
In the instance declaration for `D [a]'
-
-tcfail019.hs:18:10:
- No instance for (C [a])
- arising from the superclasses of an instance declaration
- Possible fix: add an instance declaration for (C [a])
- In the instance declaration for `D [a]'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail041.stderr b/testsuite/tests/typecheck/should_fail/tcfail041.stderr
index bfa9de546b..ae8cd47aee 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail041.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail041.stderr
@@ -3,10 +3,3 @@ tcfail041.hs:9:10:
Unbound implicit parameter (?imp::Int)
arising from the superclasses of an instance declaration
In the instance declaration for `D Int'
-
-tcfail041.hs:10:21:
- Unbound implicit parameter (?imp::Int)
- arising from a use of implicit parameter `?imp'
- In the second argument of `(+)', namely `?imp'
- In the expression: x + ?imp
- In an equation for `methodD': methodD x = x + ?imp
diff --git a/testsuite/tests/typecheck/should_fail/tcfail042.stderr b/testsuite/tests/typecheck/should_fail/tcfail042.stderr
index ba2b83fd96..76031bb221 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail042.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail042.stderr
@@ -7,18 +7,3 @@ tcfail042.hs:15:10:
Possible fix:
add (Num a) to the context of the instance declaration
In the instance declaration for `Bar [a]'
-
-tcfail042.hs:17:18:
- Could not deduce (Num a) arising from a use of `foo'
- from the context (Eq a, Show a)
- bound by the instance declaration at tcfail042.hs:15:10-34
- Possible fix:
- add (Num a) to the context of the instance declaration
- In the expression: foo xs
- In an equation for `bar':
- bar (x : xs)
- = foo xs
- where
- u = x == x
- v = show x
- In the instance declaration for `Bar [a]'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail106.stderr b/testsuite/tests/typecheck/should_fail/tcfail106.stderr
index e9de772233..09c09769ba 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail106.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail106.stderr
@@ -1,10 +1,4 @@
-tcfail106.hs:11:10:
- No instance for (S Int)
- arising from the superclasses of an instance declaration
- Possible fix: add an instance declaration for (S Int)
- In the instance declaration for `C Int'
-
tcfail106.hs:14:10:
No instance for (S Int)
arising from the superclasses of an instance declaration