summaryrefslogtreecommitdiff
path: root/testsuite/tests/numeric/should_run/arith018.hs
blob: 83c822ef3acc4d0f0fbc02efc7be327772df4c2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
-- exposes a bug in the native code generator in GHC 6.4.1.  Division by
-- a power of 2 was being mis-optimised to a direct shift.

main = do
  print (map f4 [(-20) .. (-1)])
  print (map f8 [(-20) .. (-1)])

f4 :: Int -> Int
f4 x = x `quot` 4

f8 :: Int -> Int
f8 x = x `quot` 8