diff options
Diffstat (limited to 'testsuite/tests/rep-poly/RepPolyBackpack4.bkp')
-rw-r--r-- | testsuite/tests/rep-poly/RepPolyBackpack4.bkp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/testsuite/tests/rep-poly/RepPolyBackpack4.bkp b/testsuite/tests/rep-poly/RepPolyBackpack4.bkp new file mode 100644 index 0000000000..8f151278cb --- /dev/null +++ b/testsuite/tests/rep-poly/RepPolyBackpack4.bkp @@ -0,0 +1,40 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE UnboxedTuples #-} + +unit number-unknown where + signature NumberUnknown where + import GHC.Types + import GHC.Exts + data Rep :: RuntimeRep + data Number :: TYPE Rep + plus :: Number -> Number -> Number + module NumberStuff where + import NumberUnknown + funcA :: (# Number, Number #) -> (# Number, Number #) -> Number + funcA (# x1, x2 #) _ = plus x1 x2 + +unit number-int where + module NumberUnknown where + import GHC.Types + type Rep = 'BoxedRep 'Lifted + type Number = Int + plus :: Int -> Int -> Int + plus = (+) + +unit number-unboxed-int where + module NumberUnknown where + import GHC.Types + import GHC.Prim + type Rep = IntRep + type Number = Int# + plus :: Int# -> Int# -> Int# + plus = (+#) + +unit main where + dependency number-unknown[NumberUnknown=number-unboxed-int:NumberUnknown] + module Main where + import NumberStuff + import GHC.Types + main = print (I# (funcA (# 2#, 3# #) (# 4#, 5# #))) |