summaryrefslogtreecommitdiff
path: root/testsuite/tests/unboxedsums
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2016-08-09 22:30:56 +0000
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2016-08-09 22:30:56 +0000
commite79bb2c10d66ec8f0c037e66c7d0a22aa887fdc1 (patch)
tree60063796e57d702cb468e24f34a424e52909266a /testsuite/tests/unboxedsums
parentdd23a4c067323cdc948a66f1c19fbd6b94374759 (diff)
downloadhaskell-e79bb2c10d66ec8f0c037e66c7d0a22aa887fdc1.tar.gz
Fix a bug in unboxed sum layout generation
We need to maintain the invariant that the layout fields are always sorted. Two tests that were previously broken are added.
Diffstat (limited to 'testsuite/tests/unboxedsums')
-rw-r--r--testsuite/tests/unboxedsums/unboxedsums_unit_tests.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/testsuite/tests/unboxedsums/unboxedsums_unit_tests.hs b/testsuite/tests/unboxedsums/unboxedsums_unit_tests.hs
index 5c0b929f78..399e074991 100644
--- a/testsuite/tests/unboxedsums/unboxedsums_unit_tests.hs
+++ b/testsuite/tests/unboxedsums/unboxedsums_unit_tests.hs
@@ -42,7 +42,7 @@ uniq_tests = do
layout_tests :: IO ()
layout_tests = sequence_
- [ layout1, layout2, layout3, enum_layout ]
+ [ layout1, layout2, layout3, layout4, layout5, enum_layout ]
where
assert_layout tn tys layout =
let
@@ -75,6 +75,18 @@ layout_tests = sequence_
, ubxtup [ intPrimTy, intTy, intPrimTy, intTy ] ]
[ WordSlot, PtrSlot, PtrSlot, WordSlot, WordSlot ]
+ layout4 =
+ assert_layout "layout4"
+ [ ubxtup [ floatPrimTy, floatPrimTy ]
+ , ubxtup [ intPrimTy, intPrimTy ] ]
+ [ WordSlot, WordSlot, WordSlot, FloatSlot, FloatSlot ]
+
+ layout5 =
+ assert_layout "layout5"
+ [ ubxtup [ intPrimTy, intPrimTy ]
+ , ubxtup [ floatPrimTy, floatPrimTy ] ]
+ [ WordSlot, WordSlot, WordSlot, FloatSlot, FloatSlot ]
+
enum_layout =
assert_layout "enum"
(replicate 10 (ubxtup []))