summaryrefslogtreecommitdiff
path: root/testsuite/tests/numeric/should_run/T22282A.hs
blob: 087c87c32ad97a1b49431344bcfabc56d69cf93a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# OPTIONS_GHC -O1 #-}
{-# LANGUAGE MagicHash #-}
module T22282A where

import Data.Word
import GHC.Prim
import GHC.Word

wtestF :: GHC.Prim.Word8# -> GHC.Prim.Word8# -> GHC.Prim.Word8#
wtestF a b = case word8ToWord# b of
  0## -> a
  _   -> plusWord8# (timesWord8# (quotWord8# a b) b) (remWord8# a b)
{-# NOINLINE wtestF #-}

testF :: Word8 -> Word8 -> Word8
testF (W8# a) (W8# b) = W8# (wtestF a b)
{-# INLINE testF #-}