blob: 43383a397fff6b7c8d6c8433bd822a8e9edadd05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
{-# LANGUAGE CPP #-}
#include "MachDeps.h"
f :: Int -> String
f n = case n of
#if WORD_SIZE_IN_BITS == 64
0x8000000000000000 -> "yes"
#else
0x80000000 -> "yes"
#endif
_ -> "no"
{-# NOINLINE f #-}
main = do
#if WORD_SIZE_IN_BITS == 64
let string = "0x8000000000000000"
#else
let string = "0x80000000"
#endif
let i = read string :: Integer
let i' = fromIntegral i :: Int
print i
print i'
print (f i')
|