testsuite: Mark T13075 as broken due to #13075
[ghc.git] / testsuite / tests / lib / integer / integerConversions.hs
1
2 module Main (main) where
3
4 import Data.Int
5 import Data.Word
6
7 around :: Integer -> [Integer]
8 around i = [i - 2, i - 1, i, i + 1, i + 2]
9
10 dump :: Show a => String -> [a] -> IO ()
11 dump s xs = do putStrLn "===================================="
12 putStrLn s
13 mapM_ print xs
14
15 main :: IO ()
16 main = do let xs :: [[Integer]]
17 xs = [around 0,
18 around (2^30),
19 around (2^31),
20 around (2^32),
21 around (2^33),
22 around (2^34),
23 around (2^62),
24 around (2^63),
25 around (2^64),
26 around (2^65),
27 around (2^66),
28 around (-(2^30)),
29 around (-(2^31)),
30 around (-(2^32)),
31 around (-(2^33)),
32 around (-(2^34)),
33 around (-(2^62)),
34 around (-(2^63)),
35 around (-(2^64)),
36 around (-(2^65)),
37 around (-(2^66))]
38 xsInt :: [[Int]]
39 xsInt = map (map fromInteger) xs
40 xsIntInteger :: [[Integer]]
41 xsIntInteger = map (map toInteger) xsInt
42 xsInt32 :: [[Int32]]
43 xsInt32 = map (map fromInteger) xs
44 xsInt32Integer :: [[Integer]]
45 xsInt32Integer = map (map toInteger) xsInt32
46 xsInt64 :: [[Int64]]
47 xsInt64 = map (map fromInteger) xs
48 xsInt64Integer :: [[Integer]]
49 xsInt64Integer = map (map toInteger) xsInt64
50 xsWord :: [[Word]]
51 xsWord = map (map fromInteger) xs
52 xsWordInteger :: [[Integer]]
53 xsWordInteger = map (map toInteger) xsWord
54 xsWord32 :: [[Word32]]
55 xsWord32 = map (map fromInteger) xs
56 xsWord32Integer :: [[Integer]]
57 xsWord32Integer = map (map toInteger) xsWord32
58 xsWord64 :: [[Word64]]
59 xsWord64 = map (map fromInteger) xs
60 xsWord64Integer :: [[Integer]]
61 xsWord64Integer = map (map toInteger) xsWord64
62 dump "xs" xs
63 dump "xsInt" xsInt
64 dump "xsIntInteger" xsIntInteger
65 dump "xsInt32" xsInt32
66 dump "xsInt32Integer" xsInt32Integer
67 dump "xsInt64" xsInt64
68 dump "xsInt64Integer" xsInt64Integer
69 dump "xsWord" xsWord
70 dump "xsWordInteger" xsWordInteger
71 dump "xsWord32" xsWord32
72 dump "xsWord32Integer" xsWord32Integer
73 dump "xsWord64" xsWord64
74 dump "xsWord64Integer" xsWord64Integer
75
76 test :: String -> Integer -> Integer -> IO ()
77 test what want got
78 | want == got = return ()
79 | otherwise = print (what, want, got)
80