Commit 10d28d0a authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

testsuite: Add test for floating-point abs (numrun015)

Test Plan: Validate

Reviewers: idontgetoutmuch, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D3273
parent c1dacb8a
......@@ -33,6 +33,7 @@ test('numrun011', normal, compile_and_run, [''])
test('numrun012', normal, compile_and_run, [''])
test('numrun013', normal, compile_and_run, [''])
test('numrun014', normal, compile_and_run, [''])
test('numrun015', normal, compile_and_run, [''])
test('arith016', normal, compile_and_run, [''])
test('arith017', normal, compile_and_run, [''])
test('arith018', normal, compile_and_run, [''])
......
-- Test that floating-point abs works correctly
absF :: Float -> Float
absF = abs
absD :: Double -> Double
absD = abs
main :: IO ()
main = do
print $ absF (1 / 0)
print $ absD (1 / 0)
print $ absF 1
print $ absD 1
print $ absF (-1)
print $ absD (-1)
print $ absF (-1 / 0)
print $ absD (-1 / 0)
print $ absF (1 / 0)
print $ absD (1 / 0)
Infinity
Infinity
1.0
1.0
1.0
1.0
Infinity
Infinity
Infinity
Infinity
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