diff options
Diffstat (limited to 'testsuite/tests/numeric/should_run/arith013.hs')
-rw-r--r-- | testsuite/tests/numeric/should_run/arith013.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/numeric/should_run/arith013.hs b/testsuite/tests/numeric/should_run/arith013.hs new file mode 100644 index 0000000000..a03cbb3795 --- /dev/null +++ b/testsuite/tests/numeric/should_run/arith013.hs @@ -0,0 +1,13 @@ +-- Test gcdInt/gcdInteger + +import GHC.Real ( gcdInt ) +import GHC.Num ( gcdInteger ) + +main :: IO () +main = do + test gcdInt [ -42, 0, 105 ] + test gcdInteger [-12193263111263526900, -42, 0, 105, 1234567890 ] + + +test :: Integral a => (a -> a -> a) -> [a] -> IO () +test f xs = mapM_ print [ (a, b, f a b) | a <- xs, b <- reverse xs, a /= 0 || b /= 0 ] |