From e5c968a6b55bfd302978e58962c95e5f3e87fb27 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 13 Apr 2006 08:03:00 +0000 Subject: [PATCH] forgot to add this file --- .../tests/ghc-regress/numeric/should_run/arith018.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 testsuite/tests/ghc-regress/numeric/should_run/arith018.hs diff --git a/testsuite/tests/ghc-regress/numeric/should_run/arith018.hs b/testsuite/tests/ghc-regress/numeric/should_run/arith018.hs new file mode 100644 index 0000000000..b73fd5a685 --- /dev/null +++ b/testsuite/tests/ghc-regress/numeric/should_run/arith018.hs @@ -0,0 +1,12 @@ +-- exposes a bug in the native code generator in GHC 6.4.1. Division by +-- a power of 2 was being mis-optimsed 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 -- GitLab