Commit 8f070924 authored by Joachim Breitner's avatar Joachim Breitner
Browse files

Test case for #10246

still marked known_broken. This also adds the test case for #10245,
which should pass once #10246 is fixed.
parent a838d1f7
f :: Int -> String
f n = case n of
0x8000000000000000 -> "yes"
_ -> "no"
{-# NOINLINE f #-}
main = do
let string = "0x8000000000000000"
let i = read string :: Integer
let i' = fromIntegral i :: Int
print i
print i'
print (f i')
9223372036854775808
-9223372036854775808
"yes"
f1 :: Int -> String
f1 n = case n of
0 -> "bar"
0x10000000000000000 -> "foo"
_ -> "c"
{-# NOINLINE f1 #-}
g1 :: Int -> String
g1 n = if n == 0 then "bar" else
if n == 0x10000000000000000 then "foo" else
"c"
{-# NOINLINE g1 #-}
f2 :: Int -> String
f2 n = case n of
0x10000000000000000 -> "foo"
0 -> "bar"
_ -> "c"
{-# NOINLINE f2 #-}
g2 :: Int -> String
g2 n = if n == 0x10000000000000000 then "foo" else
if n == 0 then "bar" else
"c"
{-# NOINLINE g2 #-}
main = do
let i = read "0" :: Int
print (f1 i)
print (g1 i)
print (f2 i)
print (g2 i)
......@@ -128,3 +128,5 @@ test('T9013', omit_ways(['ghci']), # ghci doesn't support unboxed tuples
test('T9340', normal, compile_and_run, [''])
test('cgrun074', normal, compile_and_run, [''])
test('CmmSwitchTest', when(fast(), skip), compile_and_run, [''])
test('T10245', expect_broken(10246), compile_and_run, [''])
test('T10246', expect_broken(10246), compile_and_run, [''])
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