Commit 43589f5c authored by avd's avatar avd Committed by Austin Seipp
Browse files

testsuite: add CmmSwitchTest for 32-bit platforms

Move CmmSwitchTest to CmmSwitchTest64, because it's broken on 32-bit
platforms. Create CmmSwitchTest32 that repeats CmmSwitchTest64 for
platforms with 32-bit wordsize.

Reviewed By: nomeata, austin, bgamari, thomie

Differential Revision: https://phabricator.haskell.org/D2226

GHC Trac Issues: #11297
parent 08e47ca9
-- This file is generated from CmmSwitchTestGen! @generated
{-# LANGUAGE MagicHash, NegativeLiterals #-}
import Control.Monad (unless, forM_)
import GHC.Exts
{-# NOINLINE aa #-}
aa :: Int# -> Int#
aa 1# = 42#
aa 2# = 43#
aa 3# = 43#
aa 4# = 44#
aa 5# = 44#
aa 6# = 45#
aa 7# = 45#
aa 8# = 46#
aa 9# = 46#
aa 10# = 47#
aa _ = 1337#
{-# NOINLINE ab #-}
ab :: Int# -> Int#
ab 0# = 42#
ab 1# = 42#
ab 2# = 43#
ab 3# = 43#
ab 4# = 44#
ab 5# = 44#
ab 6# = 45#
ab 7# = 45#
ab 8# = 46#
ab 9# = 46#
ab 10# = 47#
ab _ = 1337#
{-# NOINLINE ac #-}
ac :: Int# -> Int#
ac 1# = 42#
ac 2# = 43#
ac 3# = 43#
ac _ = 1337#
{-# NOINLINE ad #-}
ad :: Int# -> Int#
ad 1# = 42#
ad 2# = 43#
ad 3# = 43#
ad 4# = 44#
ad _ = 1337#
{-# NOINLINE ae #-}
ae :: Int# -> Int#
ae 1# = 42#
ae 2# = 43#
ae 3# = 43#
ae 4# = 44#
ae 5# = 44#
ae _ = 1337#
{-# NOINLINE af #-}
af :: Int# -> Int#
af -1# = 41#
af 0# = 42#
af 1# = 42#
af 2# = 43#
af 3# = 43#
af 4# = 44#
af 5# = 44#
af 6# = 45#
af 7# = 45#
af 8# = 46#
af 9# = 46#
af 10# = 47#
af _ = 1337#
{-# NOINLINE ag #-}
ag :: Int# -> Int#
ag -10# = 37#
ag -9# = 37#
ag -8# = 38#
ag -7# = 38#
ag -6# = 39#
ag -5# = 39#
ag -4# = 40#
ag -3# = 40#
ag -2# = 41#
ag -1# = 41#
ag 0# = 42#
ag 1# = 42#
ag 2# = 43#
ag 3# = 43#
ag 4# = 44#
ag 5# = 44#
ag 6# = 45#
ag 7# = 45#
ag 8# = 46#
ag 9# = 46#
ag 10# = 47#
ag _ = 1337#
{-# NOINLINE ah #-}
ah :: Int# -> Int#
ah -20# = 32#
ah -19# = 32#
ah -18# = 33#
ah -17# = 33#
ah -16# = 34#
ah -15# = 34#
ah -14# = 35#
ah -13# = 35#
ah -12# = 36#
ah -11# = 36#
ah -10# = 37#
ah 0# = 42#
ah 1# = 42#
ah 2# = 43#
ah 3# = 43#
ah 4# = 44#
ah 5# = 44#
ah 6# = 45#
ah 7# = 45#
ah 8# = 46#
ah 9# = 46#
ah 10# = 47#
ah _ = 1337#
{-# NOINLINE ai #-}
ai :: Int# -> Int#
ai -20# = 32#
ai -19# = 32#
ai -18# = 33#
ai -17# = 33#
ai -16# = 34#
ai -15# = 34#
ai -14# = 35#
ai -13# = 35#
ai -12# = 36#
ai -11# = 36#
ai -10# = 37#
ai 1# = 42#
ai 2# = 43#
ai 3# = 43#
ai 4# = 44#
ai 5# = 44#
ai 6# = 45#
ai 7# = 45#
ai 8# = 46#
ai 9# = 46#
ai 10# = 47#
ai _ = 1337#
{-# NOINLINE aj #-}
aj :: Int# -> Int#
aj -2147483648# = -1073741782#
aj 0# = 42#
aj 2147483647# = 1073741865#
aj _ = 1337#
{-# NOINLINE ak #-}
ak :: Int# -> Int#
ak 2147483637# = 1073741860#
ak 2147483638# = 1073741861#
ak 2147483639# = 1073741861#
ak 2147483640# = 1073741862#
ak 2147483641# = 1073741862#
ak 2147483642# = 1073741863#
ak 2147483643# = 1073741863#
ak 2147483644# = 1073741864#
ak 2147483645# = 1073741864#
ak 2147483646# = 1073741865#
ak 2147483647# = 1073741865#
ak _ = 1337#
{-# NOINLINE al #-}
al :: Int# -> Int#
al -2147483648# = -1073741782#
al -2147483647# = -1073741782#
al -2147483646# = -1073741781#
al -2147483645# = -1073741781#
al -2147483644# = -1073741780#
al -2147483643# = -1073741780#
al -2147483642# = -1073741779#
al -2147483641# = -1073741779#
al -2147483640# = -1073741778#
al -2147483639# = -1073741778#
al -2147483638# = -1073741777#
al 2147483637# = 1073741860#
al 2147483638# = 1073741861#
al 2147483639# = 1073741861#
al 2147483640# = 1073741862#
al 2147483641# = 1073741862#
al 2147483642# = 1073741863#
al 2147483643# = 1073741863#
al 2147483644# = 1073741864#
al 2147483645# = 1073741864#
al 2147483646# = 1073741865#
al 2147483647# = 1073741865#
al _ = 1337#
{-# NOINLINE am #-}
am :: Word# -> Word#
am 0## = 42##
am 1## = 42##
am 2## = 43##
am 3## = 43##
am 4## = 44##
am 5## = 44##
am 6## = 45##
am 7## = 45##
am 8## = 46##
am 9## = 46##
am 10## = 47##
am _ = 1337##
{-# NOINLINE an #-}
an :: Word# -> Word#
an 1## = 42##
an 2## = 43##
an 3## = 43##
an 4## = 44##
an 5## = 44##
an 6## = 45##
an 7## = 45##
an 8## = 46##
an 9## = 46##
an 10## = 47##
an _ = 1337##
{-# NOINLINE ao #-}
ao :: Word# -> Word#
ao 0## = 42##
ao _ = 1337##
{-# NOINLINE ap #-}
ap :: Word# -> Word#
ap 0## = 42##
ap 1## = 42##
ap _ = 1337##
{-# NOINLINE aq #-}
aq :: Word# -> Word#
aq 0## = 42##
aq 1## = 42##
aq 2## = 43##
aq _ = 1337##
{-# NOINLINE ar #-}
ar :: Word# -> Word#
ar 0## = 42##
ar 1## = 42##
ar 2## = 43##
ar 3## = 43##
ar _ = 1337##
{-# NOINLINE as #-}
as :: Word# -> Word#
as 0## = 42##
as 1## = 42##
as 2## = 43##
as 3## = 43##
as 4## = 44##
as _ = 1337##
{-# NOINLINE at #-}
at :: Word# -> Word#
at 1## = 42##
at _ = 1337##
{-# NOINLINE au #-}
au :: Word# -> Word#
au 1## = 42##
au 2## = 43##
au _ = 1337##
{-# NOINLINE av #-}
av :: Word# -> Word#
av 1## = 42##
av 2## = 43##
av 3## = 43##
av _ = 1337##
{-# NOINLINE aw #-}
aw :: Word# -> Word#
aw 1## = 42##
aw 2## = 43##
aw 3## = 43##
aw 4## = 44##
aw _ = 1337##
{-# NOINLINE ax #-}
ax :: Word# -> Word#
ax 1## = 42##
ax 2## = 43##
ax 3## = 43##
ax 4## = 44##
ax 5## = 44##
ax _ = 1337##
{-# NOINLINE ay #-}
ay :: Word# -> Word#
ay 0## = 42##
ay 4294967295## = 2147483689##
ay _ = 1337##
{-# NOINLINE az #-}
az :: Word# -> Word#
az 4294967285## = 2147483684##
az 4294967286## = 2147483685##
az 4294967287## = 2147483685##
az 4294967288## = 2147483686##
az 4294967289## = 2147483686##
az 4294967290## = 2147483687##
az 4294967291## = 2147483687##
az 4294967292## = 2147483688##
az 4294967293## = 2147483688##
az 4294967294## = 2147483689##
az 4294967295## = 2147483689##
az _ = 1337##
{-# NOINLINE ba #-}
ba :: Word# -> Word#
ba 0## = 42##
ba 1## = 42##
ba 2## = 43##
ba 3## = 43##
ba 4## = 44##
ba 5## = 44##
ba 6## = 45##
ba 7## = 45##
ba 8## = 46##
ba 9## = 46##
ba 10## = 47##
ba 4294967285## = 2147483684##
ba 4294967286## = 2147483685##
ba 4294967287## = 2147483685##
ba 4294967288## = 2147483686##
ba 4294967289## = 2147483686##
ba 4294967290## = 2147483687##
ba 4294967291## = 2147483687##
ba 4294967292## = 2147483688##
ba 4294967293## = 2147483688##
ba 4294967294## = 2147483689##
ba 4294967295## = 2147483689##
ba _ = 1337##
aa_check :: IO ()
aa_check = forM_
[ (0,1337)
, (1,42)
, (2,43)
, (3,43)
, (4,44)
, (5,44)
, (6,45)
, (7,45)
, (8,46)
, (9,46)
, (10,47)
, (11,1337)] $ \(I# i,o) -> do
let r = I# (aa i)
unless (r == o) $ putStrLn $ "ERR: aa (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
ab_check :: IO ()
ab_check = forM_
[ (-1,1337)
, (0,42)
, (1,42)
, (2,43)
, (3,43)
, (4,44)
, (5,44)
, (6,45)
, (7,45)
, (8,46)
, (9,46)
, (10,47)
, (11,1337)] $ \(I# i,o) -> do
let r = I# (ab i)
unless (r == o) $ putStrLn $ "ERR: ab (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
ac_check :: IO ()
ac_check = forM_
[ (0,1337)
, (1,42)
, (2,43)
, (3,43)
, (4,1337)] $ \(I# i,o) -> do
let r = I# (ac i)
unless (r == o) $ putStrLn $ "ERR: ac (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
ad_check :: IO ()
ad_check = forM_
[ (0,1337)
, (1,42)
, (2,43)
, (3,43)
, (4,44)
, (5,1337)] $ \(I# i,o) -> do
let r = I# (ad i)
unless (r == o) $ putStrLn $ "ERR: ad (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
ae_check :: IO ()
ae_check = forM_
[ (0,1337)
, (1,42)
, (2,43)
, (3,43)
, (4,44)
, (5,44)
, (6,1337)] $ \(I# i,o) -> do
let r = I# (ae i)
unless (r == o) $ putStrLn $ "ERR: ae (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
af_check :: IO ()
af_check = forM_
[ (-2,1337)
, (-1,41)
, (0,42)
, (1,42)
, (2,43)
, (3,43)
, (4,44)
, (5,44)
, (6,45)
, (7,45)
, (8,46)
, (9,46)
, (10,47)
, (11,1337)] $ \(I# i,o) -> do
let r = I# (af i)
unless (r == o) $ putStrLn $ "ERR: af (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
ag_check :: IO ()
ag_check = forM_
[ (-11,1337)
, (-10,37)
, (-9,37)
, (-8,38)
, (-7,38)
, (-6,39)
, (-5,39)
, (-4,40)
, (-3,40)
, (-2,41)
, (-1,41)
, (0,42)
, (1,42)
, (2,43)
, (3,43)
, (4,44)
, (5,44)
, (6,45)
, (7,45)
, (8,46)
, (9,46)
, (10,47)
, (11,1337)] $ \(I# i,o) -> do
let r = I# (ag i)
unless (r == o) $ putStrLn $ "ERR: ag (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
ah_check :: IO ()
ah_check = forM_
[ (-21,1337)
, (-20,32)
, (-19,32)
, (-18,33)
, (-17,33)
, (-16,34)
, (-15,34)
, (-14,35)
, (-13,35)
, (-12,36)
, (-11,36)
, (-10,37)
, (-9,1337)
, (-1,1337)
, (0,42)
, (1,42)
, (2,43)
, (3,43)
, (4,44)
, (5,44)
, (6,45)
, (7,45)
, (8,46)
, (9,46)
, (10,47)
, (11,1337)] $ \(I# i,o) -> do
let r = I# (ah i)
unless (r == o) $ putStrLn $ "ERR: ah (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
ai_check :: IO ()
ai_check = forM_
[ (-21,1337)
, (-20,32)
, (-19,32)
, (-18,33)
, (-17,33)
, (-16,34)
, (-15,34)
, (-14,35)
, (-13,35)
, (-12,36)
, (-11,36)
, (-10,37)
, (-9,1337)
, (0,1337)
, (1,42)
, (2,43)
, (3,43)
, (4,44)
, (5,44)
, (6,45)
, (7,45)
, (8,46)
, (9,46)
, (10,47)
, (11,1337)] $ \(I# i,o) -> do
let r = I# (ai i)
unless (r == o) $ putStrLn $ "ERR: ai (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
aj_check :: IO ()
aj_check = forM_
[ (-2147483648,-1073741782)
, (-2147483647,1337)
, (-1,1337)
, (0,42)
, (1,1337)
, (2147483646,1337)
, (2147483647,1073741865)] $ \(I# i,o) -> do
let r = I# (aj i)
unless (r == o) $ putStrLn $ "ERR: aj (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
ak_check :: IO ()
ak_check = forM_
[ (2147483636,1337)
, (2147483637,1073741860)
, (2147483638,1073741861)
, (2147483639,1073741861)
, (2147483640,1073741862)
, (2147483641,1073741862)
, (2147483642,1073741863)
, (2147483643,1073741863)
, (2147483644,1073741864)
, (2147483645,1073741864)
, (2147483646,1073741865)
, (2147483647,1073741865)] $ \(I# i,o) -> do
let r = I# (ak i)
unless (r == o) $ putStrLn $ "ERR: ak (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
al_check :: IO ()
al_check = forM_
[ (-2147483648,-1073741782)
, (-2147483647,-1073741782)
, (-2147483646,-1073741781)
, (-2147483645,-1073741781)
, (-2147483644,-1073741780)
, (-2147483643,-1073741780)
, (-2147483642,-1073741779)
, (-2147483641,-1073741779)
, (-2147483640,-1073741778)
, (-2147483639,-1073741778)
, (-2147483638,-1073741777)
, (-2147483637,1337)
, (2147483636,1337)
, (2147483637,1073741860)
, (2147483638,1073741861)
, (2147483639,1073741861)
, (2147483640,1073741862)
, (2147483641,1073741862)
, (2147483642,1073741863)
, (2147483643,1073741863)
, (2147483644,1073741864)
, (2147483645,1073741864)
, (2147483646,1073741865)
, (2147483647,1073741865)] $ \(I# i,o) -> do
let r = I# (al i)
unless (r == o) $ putStrLn $ "ERR: al (" ++ show (I# i)++ ") is " ++ show r ++ " and not " ++ show o ++"."
am_check :: IO ()
am_check = forM_
[ (0,42)
, (1,42)