summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run/T10246.hs
blob: ab4a229a9d9c1a35ce26306cf75d0151f074f4cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)