summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2020-10-22 12:08:34 +0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-11-26 16:00:32 -0500
commitbe5d74caab64abf9d986fc7290f62731db7e73e7 (patch)
tree7b1f374333ff0fb0449e9c6834c2a8210cfba7c5 /testsuite/tests
parent2ed3e6c0f179c06828712832d1176519cdfa82a6 (diff)
downloadhaskell-be5d74caab64abf9d986fc7290f62731db7e73e7.tar.gz
[Sized Cmm] properly retain sizes.
This replaces all Word<N> = W<N># Word# and Int<N> = I<N># Int# with Word<N> = W<N># Word<N># and Int<N> = I<N># Int<N>#, thus providing us with properly sized primitives in the codegenerator instead of pretending they are all full machine words. This came up when implementing darwinpcs for arm64. The darwinpcs reqires us to pack function argugments in excess of registers on the stack. While most procedure call standards (pcs) assume arguments are just passed in 8 byte slots; and thus the caller does not know the exact signature to make the call, darwinpcs requires us to adhere to the prototype, and thus have the correct sizes. If we specify CInt in the FFI call, it should correspond to the C int, and not just be Word sized, when it's only half the size. This does change the expected output of T16402 but the new result is no less correct as it eliminates the narrowing (instead of the `and` as was previously done). Bumps the array, bytestring, text, and binary submodules. Co-Authored-By: Ben Gamari <ben@well-typed.com> Metric Increase: T13701 T14697
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/array/should_run/arr020.hs10
-rw-r--r--testsuite/tests/backpack/should_compile/bkp16.stderr2
-rw-r--r--testsuite/tests/codeGen/should_run/cgrun070.hs4
-rw-r--r--testsuite/tests/codeGen/should_run/cgrun072.hs4
-rw-r--r--testsuite/tests/codeGen/should_run/cgrun075.hs6
-rw-r--r--testsuite/tests/codeGen/should_run/cgrun076.hs6
-rw-r--r--testsuite/tests/codeGen/should_run/compareByteArrays.hs4
-rw-r--r--testsuite/tests/dependent/should_compile/T14729.stderr2
-rw-r--r--testsuite/tests/dependent/should_compile/T15743.stderr2
-rw-r--r--testsuite/tests/dependent/should_compile/T15743e.stderr2
-rw-r--r--testsuite/tests/ffi/should_run/T16650a.hs2
-rw-r--r--testsuite/tests/ffi/should_run/T16650b.hs2
-rw-r--r--testsuite/tests/ffi/should_run/UnliftedNewtypesByteArrayOffset.hs4
-rw-r--r--testsuite/tests/indexed-types/should_compile/T15711.stderr2
-rw-r--r--testsuite/tests/indexed-types/should_compile/T15852.stderr2
-rw-r--r--testsuite/tests/lib/integer/integerImportExport.hs4
-rw-r--r--testsuite/tests/numeric/should_compile/T16402.stderr-ws-32133
-rw-r--r--testsuite/tests/numeric/should_compile/T16402.stderr-ws-64 (renamed from testsuite/tests/numeric/should_compile/T16402.stderr)11
-rw-r--r--testsuite/tests/parser/should_run/BinaryLiterals2.hs3
-rw-r--r--testsuite/tests/polykinds/T15592.stderr2
-rw-r--r--testsuite/tests/polykinds/T15592b.stderr2
-rw-r--r--testsuite/tests/printer/T18052a.stderr5
-rw-r--r--testsuite/tests/profiling/should_run/T3001-2.hs5
-rw-r--r--testsuite/tests/simplCore/should_compile/T5359a.hs4
-rw-r--r--testsuite/tests/simplCore/should_compile/T8832.stdout11
-rw-r--r--testsuite/tests/simplCore/should_compile/T8832.stdout-ws-3212
-rw-r--r--testsuite/tests/simplCore/should_compile/T8832.stdout-ws-6411
-rw-r--r--testsuite/tests/typecheck/should_compile/T12763.stderr2
28 files changed, 194 insertions, 65 deletions
diff --git a/testsuite/tests/array/should_run/arr020.hs b/testsuite/tests/array/should_run/arr020.hs
index bb025eff03..db715b054e 100644
--- a/testsuite/tests/array/should_run/arr020.hs
+++ b/testsuite/tests/array/should_run/arr020.hs
@@ -20,12 +20,12 @@ newByteArray (I# n#)
writeByteArray :: MutableByteArray s -> Int -> Word32 -> ST s ()
writeByteArray (MutableByteArray mba#) (I# i#) (W32# w#)
- = ST $ \s# -> case writeWord32Array# mba# i# w# s# of
+ = ST $ \s# -> case writeWord32Array# mba# i# (extendWord32# w#) s# of
s'# -> (# s'#, () #)
indexArray :: ByteArray Word32 -> Int -> Word32
indexArray (ByteArray arr#) (I# i#)
- = W32# (indexWord32Array# arr# i#)
+ = W32# (narrowWord32# (indexWord32Array# arr# i#))
unsafeFreezeByteArray :: MutableByteArray s -> ST s (ByteArray e)
unsafeFreezeByteArray (MutableByteArray mba#)
@@ -68,7 +68,7 @@ unsafeFreezeArrayArray (MutableArrayArray marrs#)
(# s'#, arrs# #) -> (# s'#, ArrayArray arrs# #)
unsafeDeepFreezeArrayArray :: forall s e
- . MutableArrayArray s (MutableByteArray s)
+ . MutableArrayArray s (MutableByteArray s)
-> ST s (ArrayArray (ByteArray e))
unsafeDeepFreezeArrayArray marrs@(MutableArrayArray marrs#)
= do { let n = I# (sizeofMutableArrayArray# marrs#)
@@ -112,7 +112,7 @@ newUnboxedArray2D values
}
unboxedArray2D :: UnboxedArray2D Word32
-unboxedArray2D
+unboxedArray2D
= newUnboxedArray2D
[ [1..10]
, [11..200]
@@ -125,7 +125,7 @@ indexUnboxedArray2D :: UnboxedArray2D Word32 -> (Int, Int) -> Word32
indexUnboxedArray2D arr (i, j)
= indexArrayArray arr i `indexArray` j
-main
+main
= do { print $ unboxedArray2D `indexUnboxedArray2D` (3, 1000)
; performGC
; print $ unboxedArray2D `indexUnboxedArray2D` (3, 1000)
diff --git a/testsuite/tests/backpack/should_compile/bkp16.stderr b/testsuite/tests/backpack/should_compile/bkp16.stderr
index f035aae2e1..d09d6e6823 100644
--- a/testsuite/tests/backpack/should_compile/bkp16.stderr
+++ b/testsuite/tests/backpack/should_compile/bkp16.stderr
@@ -4,5 +4,5 @@
Instantiating q
[1 of 1] Including p[Int=base-4.13.0.0:GHC.Exts]
Instantiating p[Int=base-4.13.0.0:GHC.Exts]
- [1 of 1] Including ghc-prim-0.7.0
+ [1 of 1] Including ghc-prim-0.8.0
[1 of 1] Compiling Int[sig] ( p/Int.hsig, bkp16.out/p/p-97PZnzqiJmd2hTwUNGdjod/Int.o )
diff --git a/testsuite/tests/codeGen/should_run/cgrun070.hs b/testsuite/tests/codeGen/should_run/cgrun070.hs
index d37032a707..53f640116f 100644
--- a/testsuite/tests/codeGen/should_run/cgrun070.hs
+++ b/testsuite/tests/codeGen/should_run/cgrun070.hs
@@ -196,11 +196,11 @@ touch a = unsafeIOToST $ IO $ \s# ->
indexWord8Array :: ByteArray -> Int -> Word8
indexWord8Array arr (I# i#) = case indexWord8Array# (unBA arr) i# of
- a -> W8# a
+ a -> W8# (narrowWord8# a)
writeWord8Array :: MByteArray s -> Int -> Word8 -> ST s ()
writeWord8Array marr (I# i#) (W8# a) = ST $ \ s# ->
- case writeWord8Array# (unMBA marr) i# a s# of
+ case writeWord8Array# (unMBA marr) i# (extendWord8# a) s# of
s2# -> (# s2#, () #)
unsafeFreezeByteArray :: MByteArray s -> ST s (ByteArray)
diff --git a/testsuite/tests/codeGen/should_run/cgrun072.hs b/testsuite/tests/codeGen/should_run/cgrun072.hs
index 403bc49a3c..fb1b26252f 100644
--- a/testsuite/tests/codeGen/should_run/cgrun072.hs
+++ b/testsuite/tests/codeGen/should_run/cgrun072.hs
@@ -31,10 +31,10 @@ main = do putStrLn test_primop_bSwap16
putStrLn test'_base_bSwap64
bswap16 :: Word16 -> Word16
-bswap16 (W16# w#) = W16# (narrow16Word# (byteSwap16# w#))
+bswap16 (W16# w#) = W16# (narrowWord16# (byteSwap16# (extendWord16# w#)))
bswap32 :: Word32 -> Word32
-bswap32 (W32# w#) = W32# (narrow32Word# (byteSwap32# w#))
+bswap32 (W32# w#) = W32# (narrowWord32# (byteSwap32# (extendWord32# w#)))
bswap64 :: Word64 -> Word64
bswap64 (W64# w#) = W64# (byteSwap64# w#)
diff --git a/testsuite/tests/codeGen/should_run/cgrun075.hs b/testsuite/tests/codeGen/should_run/cgrun075.hs
index 09e35b4d8a..89a4679e5f 100644
--- a/testsuite/tests/codeGen/should_run/cgrun075.hs
+++ b/testsuite/tests/codeGen/should_run/cgrun075.hs
@@ -27,13 +27,13 @@ instance Pdep Word where
pdep (W# src#) (W# mask#) = W# (pdep# src# mask#)
instance Pdep Word8 where
- pdep (W8# src#) (W8# mask#) = W8# (pdep8# src# mask#)
+ pdep (W8# src#) (W8# mask#) = W8# (narrowWord8# (pdep8# (extendWord8# src#) (extendWord8# mask#)))
instance Pdep Word16 where
- pdep (W16# src#) (W16# mask#) = W16# (pdep16# src# mask#)
+ pdep (W16# src#) (W16# mask#) = W16# (narrowWord16# (pdep16# (extendWord16# src#) (extendWord16# mask#)))
instance Pdep Word32 where
- pdep (W32# src#) (W32# mask#) = W32# (pdep32# src# mask#)
+ pdep (W32# src#) (W32# mask#) = W32# (narrowWord32# (pdep32# (extendWord32# src#) (extendWord32# mask#)))
instance Pdep Word64 where
pdep (W64# src#) (W64# mask#) = W64# (pdep64# src# mask#)
diff --git a/testsuite/tests/codeGen/should_run/cgrun076.hs b/testsuite/tests/codeGen/should_run/cgrun076.hs
index 7fa42d74e0..a6ae331cf6 100644
--- a/testsuite/tests/codeGen/should_run/cgrun076.hs
+++ b/testsuite/tests/codeGen/should_run/cgrun076.hs
@@ -27,13 +27,13 @@ instance Pext Word where
pext (W# src#) (W# mask#) = W# (pext# src# mask#)
instance Pext Word8 where
- pext (W8# src#) (W8# mask#) = W8# (pext8# src# mask#)
+ pext (W8# src#) (W8# mask#) = W8# (narrowWord8# (pext8# (extendWord8# src#) (extendWord8# mask#)))
instance Pext Word16 where
- pext (W16# src#) (W16# mask#) = W16# (pext16# src# mask#)
+ pext (W16# src#) (W16# mask#) = W16# (narrowWord16# (pext16# (extendWord16# src#) (extendWord16# mask#)))
instance Pext Word32 where
- pext (W32# src#) (W32# mask#) = W32# (pext32# src# mask#)
+ pext (W32# src#) (W32# mask#) = W32# (narrowWord32# (pext32# (extendWord32# src#) (extendWord32# mask#)))
instance Pext Word64 where
pext (W64# src#) (W64# mask#) = W64# (pext64# src# mask#)
diff --git a/testsuite/tests/codeGen/should_run/compareByteArrays.hs b/testsuite/tests/codeGen/should_run/compareByteArrays.hs
index 5bd0e58588..e155bc45a5 100644
--- a/testsuite/tests/codeGen/should_run/compareByteArrays.hs
+++ b/testsuite/tests/codeGen/should_run/compareByteArrays.hs
@@ -39,7 +39,7 @@ copyByteArray (BA# src#) (I# srcOfs#) (MBA# dest#) (I# destOfs#) (I# n#)
indexWord8Array :: BA -> Int -> Word8
indexWord8Array (BA# ba#) (I# i#)
- = W8# (indexWord8Array# ba# i#)
+ = W8# (narrowWord8# (indexWord8Array# ba# i#))
sizeofByteArray :: BA -> Int
sizeofByteArray (BA# ba#) = I# (sizeofByteArray# ba#)
@@ -54,7 +54,7 @@ newByteArray (I# n#)
writeWord8Array :: MBA s -> Int -> Word8 -> ST s ()
writeWord8Array (MBA# mba#) (I# i#) (W8# j#)
- = ST $ \s -> case writeWord8Array# mba# i# j# s of
+ = ST $ \s -> case writeWord8Array# mba# i# (extendWord8# j#) s of
s' -> (# s', () #)
unsafeFreezeByteArray :: MBA s -> ST s BA
diff --git a/testsuite/tests/dependent/should_compile/T14729.stderr b/testsuite/tests/dependent/should_compile/T14729.stderr
index f3e8a1fdf9..60707bb193 100644
--- a/testsuite/tests/dependent/should_compile/T14729.stderr
+++ b/testsuite/tests/dependent/should_compile/T14729.stderr
@@ -11,4 +11,4 @@ COERCION AXIOMS
FAMILY INSTANCES
type instance F Int = Bool -- Defined at T14729.hs:10:15
Dependent modules: []
-Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
+Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.8.0]
diff --git a/testsuite/tests/dependent/should_compile/T15743.stderr b/testsuite/tests/dependent/should_compile/T15743.stderr
index 4aeecbcc23..20bfaafadb 100644
--- a/testsuite/tests/dependent/should_compile/T15743.stderr
+++ b/testsuite/tests/dependent/should_compile/T15743.stderr
@@ -3,4 +3,4 @@ TYPE CONSTRUCTORS
forall {k1} k2 (k3 :: k2). Proxy k3 -> k1 -> k2 -> *
roles nominal nominal nominal phantom phantom phantom
Dependent modules: []
-Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
+Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.8.0]
diff --git a/testsuite/tests/dependent/should_compile/T15743e.stderr b/testsuite/tests/dependent/should_compile/T15743e.stderr
index 01e20c63b9..8db06cbdcb 100644
--- a/testsuite/tests/dependent/should_compile/T15743e.stderr
+++ b/testsuite/tests/dependent/should_compile/T15743e.stderr
@@ -54,4 +54,4 @@ DATA CONSTRUCTORS
(d :: Proxy k5) (e :: Proxy k7).
f c -> T k8 a b f c d e
Dependent modules: []
-Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
+Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.8.0]
diff --git a/testsuite/tests/ffi/should_run/T16650a.hs b/testsuite/tests/ffi/should_run/T16650a.hs
index ab1cd9c67e..6a43a55118 100644
--- a/testsuite/tests/ffi/should_run/T16650a.hs
+++ b/testsuite/tests/ffi/should_run/T16650a.hs
@@ -44,4 +44,4 @@ luckySingleton = IO $ \s0 -> case newByteArray# 1# s0 of
readByteArray :: MutableByteArray -> Int -> IO Word8
readByteArray (MutableByteArray b#) (I# i#) = IO $ \s0 ->
case readWord8Array# b# i# s0 of
- (# s1, w #) -> (# s1, W8# w #)
+ (# s1, w #) -> (# s1, W8# (narrowWord8# w) #)
diff --git a/testsuite/tests/ffi/should_run/T16650b.hs b/testsuite/tests/ffi/should_run/T16650b.hs
index 763329fc8b..ba0d4a72a0 100644
--- a/testsuite/tests/ffi/should_run/T16650b.hs
+++ b/testsuite/tests/ffi/should_run/T16650b.hs
@@ -53,7 +53,7 @@ luckySingleton = IO $ \s0 -> case newByteArray# 1# s0 of
readByteArray :: MutableByteArray -> Int -> IO Word8
readByteArray (MutableByteArray b#) (I# i#) = IO $ \s0 ->
case readWord8Array# b# i# s0 of
- (# s1, w #) -> (# s1, W8# w #)
+ (# s1, w #) -> (# s1, W8# (narrowWord8# w) #)
-- Write a mutable byte array to the array of mutable byte arrays
-- at the given index.
diff --git a/testsuite/tests/ffi/should_run/UnliftedNewtypesByteArrayOffset.hs b/testsuite/tests/ffi/should_run/UnliftedNewtypesByteArrayOffset.hs
index 8e0aaeef50..8953e9b02d 100644
--- a/testsuite/tests/ffi/should_run/UnliftedNewtypesByteArrayOffset.hs
+++ b/testsuite/tests/ffi/should_run/UnliftedNewtypesByteArrayOffset.hs
@@ -35,7 +35,7 @@ main = do
readByteArray :: MutableByteArray -> Int -> IO Word8
readByteArray (MutableByteArray b#) (I# i#) = IO $ \s0 ->
case readWord8Array# b# i# s0 of
- (# s1, w #) -> (# s1, W8# w #)
+ (# s1, w #) -> (# s1, W8# (narrowWord8# w) #)
-- Create a new mutable byte array of length 1 with the sole byte
-- set to the 105.
@@ -43,5 +43,3 @@ luckySingleton :: IO MutableByteArray
luckySingleton = IO $ \s0 -> case newByteArray# 1# s0 of
(# s1, marr# #) -> case writeWord8Array# marr# 0# 105## s1 of
s2 -> (# s2, MutableByteArray marr# #)
-
-
diff --git a/testsuite/tests/indexed-types/should_compile/T15711.stderr b/testsuite/tests/indexed-types/should_compile/T15711.stderr
index 3e5cf86195..7c47eaf82a 100644
--- a/testsuite/tests/indexed-types/should_compile/T15711.stderr
+++ b/testsuite/tests/indexed-types/should_compile/T15711.stderr
@@ -3,4 +3,4 @@ TYPE CONSTRUCTORS
associated type family F{2} :: forall a. Maybe a -> *
roles nominal nominal
Dependent modules: []
-Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
+Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.8.0]
diff --git a/testsuite/tests/indexed-types/should_compile/T15852.stderr b/testsuite/tests/indexed-types/should_compile/T15852.stderr
index 05aef7ca0d..8c212a06b6 100644
--- a/testsuite/tests/indexed-types/should_compile/T15852.stderr
+++ b/testsuite/tests/indexed-types/should_compile/T15852.stderr
@@ -9,4 +9,4 @@ FAMILY INSTANCES
data instance forall {k1} {k2} {j :: k1} {c :: k2}.
DF (Proxy c) -- Defined at T15852.hs:10:15
Dependent modules: []
-Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
+Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.8.0]
diff --git a/testsuite/tests/lib/integer/integerImportExport.hs b/testsuite/tests/lib/integer/integerImportExport.hs
index bef208afd0..ab044214ed 100644
--- a/testsuite/tests/lib/integer/integerImportExport.hs
+++ b/testsuite/tests/lib/integer/integerImportExport.hs
@@ -33,13 +33,13 @@ newByteArray :: Word# -> IO MBA
newByteArray sz = IO $ \s -> case newPinnedByteArray# (word2Int# sz) s of (# s, arr #) -> (# s, MBA arr #)
indexByteArray :: ByteArray# -> Word# -> Word8
-indexByteArray a# n# = W8# (indexWord8Array# a# (word2Int# n#))
+indexByteArray a# n# = W8# (narrowWord8# (indexWord8Array# a# (word2Int# n#)))
-- indexMutableByteArray :: MutableByteArray# RealWorld -> Word# -> IO Word8
-- indexMutableByteArray a# n# = IO $ \s -> case readWord8Array# a# (word2Int# n#) s of (# s', v #) -> (# s', W# v #)
writeByteArray :: MutableByteArray# RealWorld -> Int# -> Word8 -> IO ()
-writeByteArray arr i (W8# w) = IO $ \s -> case writeWord8Array# arr i w s of s -> (# s, () #)
+writeByteArray arr i (W8# w) = IO $ \s -> case writeWord8Array# arr i (extendWord8# w) s of s -> (# s, () #)
lengthByteArray :: ByteArray# -> Word
lengthByteArray ba = W# (int2Word# (sizeofByteArray# ba))
diff --git a/testsuite/tests/numeric/should_compile/T16402.stderr-ws-32 b/testsuite/tests/numeric/should_compile/T16402.stderr-ws-32
new file mode 100644
index 0000000000..726bcc374e
--- /dev/null
+++ b/testsuite/tests/numeric/should_compile/T16402.stderr-ws-32
@@ -0,0 +1,133 @@
+
+==================== Tidy Core ====================
+Result size of Tidy Core
+ = {terms: 124, types: 172, coercions: 0, joins: 0/0}
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$trModule4 = "main"#
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+$trModule3 = TrNameS $trModule4
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$trModule2 = "T16402"#
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+$trModule1 = TrNameS $trModule2
+
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+$trModule = Module $trModule3 $trModule1
+
+-- RHS size: {terms: 18, types: 25, coercions: 0, joins: 0/0}
+smallWord_bar
+ = \ x ->
+ case x of { W64# x# ->
+ case {__pkg_ccall ghc-prim Word64#
+ -> State# RealWorld -> (# State# RealWorld, Word# #)}
+ x# realWorld#
+ of
+ { (# ds1, ds2 #) ->
+ case {__pkg_ccall ghc-prim Word#
+ -> State# RealWorld -> (# State# RealWorld, Word64# #)}
+ (and# ds2 0xffff##) realWorld#
+ of
+ { (# ds4, ds5 #) ->
+ W64# ds5
+ }
+ }
+ }
+
+-- RHS size: {terms: 24, types: 36, coercions: 0, joins: 0/0}
+smallWord_foo
+ = \ x ->
+ case x of { W64# x# ->
+ case {__pkg_ccall ghc-prim Word64#
+ -> Word64# -> State# RealWorld -> (# State# RealWorld, Word64# #)}
+ x# 0xffff##64 realWorld#
+ of
+ { (# ds2, ds3 #) ->
+ case {__pkg_ccall ghc-prim Word64#
+ -> State# RealWorld -> (# State# RealWorld, Word# #)}
+ ds3 realWorld#
+ of
+ { (# ds1, ds4 #) ->
+ case {__pkg_ccall ghc-prim Word#
+ -> State# RealWorld -> (# State# RealWorld, Word64# #)}
+ (and# ds4 0xffff##) realWorld#
+ of
+ { (# ds5, ds6 #) ->
+ W64# ds6
+ }
+ }
+ }
+ }
+
+-- RHS size: {terms: 18, types: 25, coercions: 0, joins: 0/0}
+smallInt_bar
+ = \ x ->
+ case x of { I64# x# ->
+ case {__pkg_ccall ghc-prim Int64#
+ -> State# RealWorld -> (# State# RealWorld, Int# #)}
+ x# realWorld#
+ of
+ { (# ds1, ds2 #) ->
+ case {__pkg_ccall ghc-prim Int#
+ -> State# RealWorld -> (# State# RealWorld, Int64# #)}
+ (extendInt16# (narrowInt16# ds2)) realWorld#
+ of
+ { (# ds4, ds5 #) ->
+ I64# ds5
+ }
+ }
+ }
+
+-- RHS size: {terms: 35, types: 67, coercions: 0, joins: 0/0}
+$wsmallInt_foo
+ = \ ww ->
+ case {__pkg_ccall ghc-prim Int64#
+ -> State# RealWorld -> (# State# RealWorld, Word64# #)}
+ 1245183#64 realWorld#
+ of
+ { (# ds2, ds3 #) ->
+ case {__pkg_ccall ghc-prim Int64#
+ -> State# RealWorld -> (# State# RealWorld, Word64# #)}
+ ww realWorld#
+ of
+ { (# ds4, ds5 #) ->
+ case {__pkg_ccall ghc-prim Word64#
+ -> Word64# -> State# RealWorld -> (# State# RealWorld, Word64# #)}
+ ds5 ds3 realWorld#
+ of
+ { (# ds6, ds7 #) ->
+ case {__pkg_ccall ghc-prim Word64#
+ -> State# RealWorld -> (# State# RealWorld, Int64# #)}
+ ds7 realWorld#
+ of
+ { (# ds8, ds9 #) ->
+ case {__pkg_ccall ghc-prim Int64#
+ -> State# RealWorld -> (# State# RealWorld, Int# #)}
+ ds9 realWorld#
+ of
+ { (# ds1, ds11 #) ->
+ case {__pkg_ccall ghc-prim Int#
+ -> State# RealWorld -> (# State# RealWorld, Int64# #)}
+ (extendInt16# (narrowInt16# ds11)) realWorld#
+ of
+ { (# ds12, ds13 #) ->
+ ds13
+ }
+ }
+ }
+ }
+ }
+ }
+
+-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0}
+smallInt_foo
+ = \ w ->
+ case w of { I64# ww1 ->
+ case $wsmallInt_foo ww1 of ww2 { __DEFAULT -> I64# ww2 }
+ }
+
+
+
diff --git a/testsuite/tests/numeric/should_compile/T16402.stderr b/testsuite/tests/numeric/should_compile/T16402.stderr-ws-64
index 75db843376..d81adaaa7b 100644
--- a/testsuite/tests/numeric/should_compile/T16402.stderr
+++ b/testsuite/tests/numeric/should_compile/T16402.stderr-ws-64
@@ -1,7 +1,7 @@
==================== Tidy Core ====================
Result size of Tidy Core
- = {terms: 34, types: 19, coercions: 0, joins: 0/0}
+ = {terms: 36, types: 19, coercions: 0, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule4 = "main"#
@@ -18,16 +18,17 @@ $trModule1 = TrNameS $trModule2
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$trModule = Module $trModule3 $trModule1
--- RHS size: {terms: 7, types: 3, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0}
smallWord_bar
- = \ x -> case x of { W64# x# -> W64# (narrow16Word# x#) }
+ = \ x -> case x of { W64# x# -> W64# (and# x# 0xffff##) }
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
smallWord_foo = smallWord_bar
--- RHS size: {terms: 7, types: 3, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0}
smallInt_bar
- = \ x -> case x of { I64# x# -> I64# (narrow16Int# x#) }
+ = \ x ->
+ case x of { I64# x# -> I64# (extendInt16# (narrowInt16# x#)) }
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
smallInt_foo = smallInt_bar
diff --git a/testsuite/tests/parser/should_run/BinaryLiterals2.hs b/testsuite/tests/parser/should_run/BinaryLiterals2.hs
index 3779d52341..305a12cab3 100644
--- a/testsuite/tests/parser/should_run/BinaryLiterals2.hs
+++ b/testsuite/tests/parser/should_run/BinaryLiterals2.hs
@@ -6,6 +6,7 @@
module Main where
+import GHC.Base
import GHC.Types
import GHC.Int
@@ -26,4 +27,4 @@ main = do
, -0B11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
]
- print [ I8# -0B10000000#, I8# 0B1111111# ]
+ print [ I8# (narrowInt8# -0B10000000#), I8# (narrowInt8# 0B1111111#) ]
diff --git a/testsuite/tests/polykinds/T15592.stderr b/testsuite/tests/polykinds/T15592.stderr
index 5f0334b43b..c0f494f281 100644
--- a/testsuite/tests/polykinds/T15592.stderr
+++ b/testsuite/tests/polykinds/T15592.stderr
@@ -5,4 +5,4 @@ DATA CONSTRUCTORS
MkT :: forall {k} k1 (f :: k1 -> k -> *) (a :: k1) (b :: k).
f a b -> T f a b -> T f a b
Dependent modules: []
-Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
+Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.8.0]
diff --git a/testsuite/tests/polykinds/T15592b.stderr b/testsuite/tests/polykinds/T15592b.stderr
index e2a538f9d8..e64b81cebe 100644
--- a/testsuite/tests/polykinds/T15592b.stderr
+++ b/testsuite/tests/polykinds/T15592b.stderr
@@ -4,4 +4,4 @@ TYPE CONSTRUCTORS
forall k (f :: k -> *) (a :: k). f a -> *
roles nominal nominal nominal nominal
Dependent modules: []
-Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
+Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.8.0]
diff --git a/testsuite/tests/printer/T18052a.stderr b/testsuite/tests/printer/T18052a.stderr
index de339de3c4..582a14a32c 100644
--- a/testsuite/tests/printer/T18052a.stderr
+++ b/testsuite/tests/printer/T18052a.stderr
@@ -6,7 +6,7 @@ TYPE CONSTRUCTORS
PATTERN SYNONYMS
(:||:) :: forall {a} {b}. a -> b -> (a, b)
Dependent modules: []
-Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
+Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.8.0]
==================== Tidy Core ====================
Result size of Tidy Core
@@ -36,6 +36,3 @@ T18052a.$m:||:
(cont :: a -> b -> r)
_ [Occ=Dead] ->
case scrut of { (x, y) -> cont x y }
-
-
-
diff --git a/testsuite/tests/profiling/should_run/T3001-2.hs b/testsuite/tests/profiling/should_run/T3001-2.hs
index 6511491a46..186fd2f2f9 100644
--- a/testsuite/tests/profiling/should_run/T3001-2.hs
+++ b/testsuite/tests/profiling/should_run/T3001-2.hs
@@ -153,7 +153,7 @@ readN :: Int -> (S.ByteString -> a) -> Get a
readN n f = fmap f $ getBytes n
shiftl_w32 :: Word32 -> Int -> Word32
-shiftl_w32 (W32# w) (I# i) = W32# (w `uncheckedShiftL#` i)
+shiftl_w32 (W32# w) (I# i) = W32# (narrowWord32# ((extendWord32# w) `uncheckedShiftL#` i))
getPtr :: Storable a => Int -> Get a
getPtr n = do
@@ -274,7 +274,7 @@ putWord32beB w = writeN 4 $ \p -> do
poke (p `plusPtr` 3) (fromIntegral (w) :: Word8)
shiftr_w32 :: Word32 -> Int -> Word32
-shiftr_w32 (W32# w) (I# i) = W32# (w `uncheckedShiftRL#` i)
+shiftr_w32 (W32# w) (I# i) = W32# (narrowWord32# ((extendWord32# w) `uncheckedShiftRL#` i))
flush :: Builder
flush = Builder $ \ k buf@(Buffer p o u l) ->
@@ -291,4 +291,3 @@ instance Semigroup Builder where
instance Monoid Builder where
mempty = emptyBuilder
mappend = (<>)
-
diff --git a/testsuite/tests/simplCore/should_compile/T5359a.hs b/testsuite/tests/simplCore/should_compile/T5359a.hs
index ebe85ba4a0..8c4a0beaf7 100644
--- a/testsuite/tests/simplCore/should_compile/T5359a.hs
+++ b/testsuite/tests/simplCore/should_compile/T5359a.hs
@@ -61,7 +61,7 @@ textP arr off len | len == 0 = emptyT
{-# INLINE textP #-}
unsafeChrT :: Word16 -> Char
-unsafeChrT (W16# w#) = C# (chr# (word2Int# w#))
+unsafeChrT (W16# w#) = C# (chr# (word2Int# (extendWord16# w#)))
{-# INLINE unsafeChrT #-}
data Array = Array ByteArray#
@@ -82,7 +82,7 @@ unsafeFreeze (MArray maBA) = ST $ \s# -> (# s#, Array (unsafeCoerce# maBA) #)
unsafeIndex :: Array -> Int -> Word16
unsafeIndex (Array aBA) (I# i#) =
- case indexWord16Array# aBA i# of r# -> (W16# r#)
+ case indexWord16Array# aBA i# of r# -> (W16# (narrowWord16# r#))
{-# INLINE unsafeIndex #-}
empty :: Array
diff --git a/testsuite/tests/simplCore/should_compile/T8832.stdout b/testsuite/tests/simplCore/should_compile/T8832.stdout
deleted file mode 100644
index 3e23710089..0000000000
--- a/testsuite/tests/simplCore/should_compile/T8832.stdout
+++ /dev/null
@@ -1,11 +0,0 @@
-i = GHC.Types.I# 0#
-i8 = GHC.Int.I8# 0#
-i16 = GHC.Int.I16# 0#
-i32 = GHC.Int.I32# 0#
-i64 = GHC.Int.I64# 0#
-w = GHC.Types.W# 0##
-w8 = GHC.Word.W8# 0##
-w16 = GHC.Word.W16# 0##
-w32 = GHC.Word.W32# 0##
-w64 = GHC.Word.W64# 0##
-z = 0
diff --git a/testsuite/tests/simplCore/should_compile/T8832.stdout-ws-32 b/testsuite/tests/simplCore/should_compile/T8832.stdout-ws-32
index 3186412561..459d2689c7 100644
--- a/testsuite/tests/simplCore/should_compile/T8832.stdout-ws-32
+++ b/testsuite/tests/simplCore/should_compile/T8832.stdout-ws-32
@@ -1,9 +1,9 @@
i = GHC.Types.I# 0#
-i8 = GHC.Int.I8# 0#
-i16 = GHC.Int.I16# 0#
-i32 = GHC.Int.I32# 0#
+i8 = GHC.Int.I8# 0#8
+i16 = GHC.Int.I16# 0#16
+i32 = GHC.Int.I32# 0#32
w = GHC.Types.W# 0##
-w8 = GHC.Word.W8# 0##
-w16 = GHC.Word.W16# 0##
-w32 = GHC.Word.W32# 0##
+w8 = GHC.Word.W8# 0##8
+w16 = GHC.Word.W16# 0##16
+w32 = GHC.Word.W32# 0##32
z = 0
diff --git a/testsuite/tests/simplCore/should_compile/T8832.stdout-ws-64 b/testsuite/tests/simplCore/should_compile/T8832.stdout-ws-64
new file mode 100644
index 0000000000..657f517c68
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T8832.stdout-ws-64
@@ -0,0 +1,11 @@
+i = GHC.Types.I# 0#
+i8 = GHC.Int.I8# 0#8
+i16 = GHC.Int.I16# 0#16
+i32 = GHC.Int.I32# 0#32
+i64 = GHC.Int.I64# 0#
+w = GHC.Types.W# 0##
+w8 = GHC.Word.W8# 0##8
+w16 = GHC.Word.W16# 0##16
+w32 = GHC.Word.W32# 0##32
+w64 = GHC.Word.W64# 0##
+z = 0
diff --git a/testsuite/tests/typecheck/should_compile/T12763.stderr b/testsuite/tests/typecheck/should_compile/T12763.stderr
index 552fd5f1d2..2496d16dcd 100644
--- a/testsuite/tests/typecheck/should_compile/T12763.stderr
+++ b/testsuite/tests/typecheck/should_compile/T12763.stderr
@@ -8,4 +8,4 @@ COERCION AXIOMS
CLASS INSTANCES
instance C Int -- Defined at T12763.hs:9:10
Dependent modules: []
-Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
+Dependent packages: [base-4.16.0.0, ghc-bignum-1.0, ghc-prim-0.8.0]