Commit 744035fd authored by tibbe's avatar tibbe

Fix Word2Float# test on 32-bit

parent 83bfdc2f
......@@ -342,6 +342,12 @@ def if_wordsize( ws, f ):
else:
return normal
def unless_wordsize( ws, f ):
if config.wordsize == str(ws):
return normal
else:
return f
def if_msys( f ):
if config.msys:
return f
......
{-# LANGUAGE MagicHash #-}
module Main (main) where
import GHC.Exts (Double(D#), Float(F#), word2Double#, word2Float#)
main :: IO ()
main = do
print (D# (word2Double# 0##))
-- 4294967295 is 2^32 - 1, the largest 32-bit integer, and can be
-- stored in a 64-bit IEEE floating-point value without loss of
-- precision.
print (D# (word2Double# 4294967295##))
print (F# (word2Float# 0##))
-- 16777216 is 2^24, which is the largest integer which can be
-- stored in a 32-bit IEEE floating-point value without loss of
-- precision
print (F# (word2Float# 16777216##))
......@@ -100,4 +100,5 @@ test('T7319', [ extra_ways(['prof']), only_ways(['prof']), exit_code(1),
req_profiling,
extra_hc_opts('-fprof-auto'),
extra_run_opts('+RTS -xc') ], compile_and_run, [''])
test('Word2Float', normal, compile_and_run, [''])
test('Word2Float32', unless_wordsize(32, skip), compile_and_run, [''])
test('Word2Float64', unless_wordsize(64, skip), compile_and_run, [''])
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