diff options
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/ghc-compact/tests/all.T | 1 | ||||
-rw-r--r-- | libraries/ghc-compact/tests/compact_small_ptr_array.hs | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libraries/ghc-compact/tests/all.T b/libraries/ghc-compact/tests/all.T index 753592e733..0264bab6b2 100644 --- a/libraries/ghc-compact/tests/all.T +++ b/libraries/ghc-compact/tests/all.T @@ -4,6 +4,7 @@ test('compact_simple', normal, compile_and_run, ['']) test('compact_loop', normal, compile_and_run, ['']) test('compact_append', normal, compile_and_run, ['']) test('compact_autoexpand', normal, compile_and_run, ['']) +test('compact_small_array', [reqlib('primitive')], compile_and_run, ['']) test('compact_simple_array', normal, compile_and_run, ['']) test('compact_huge_array', normal, compile_and_run, ['']) test('compact_serialize', normal, compile_and_run, ['']) diff --git a/libraries/ghc-compact/tests/compact_small_ptr_array.hs b/libraries/ghc-compact/tests/compact_small_ptr_array.hs new file mode 100644 index 0000000000..8599c71e77 --- /dev/null +++ b/libraries/ghc-compact/tests/compact_small_ptr_array.hs @@ -0,0 +1,8 @@ +import GHC.Compact +import Data.Primitive.SmallArray + +main :: IO () +main = do + arr <- newSmallArray 5 (Just 'a') + arr' <- compact arr + print $ getCompact arr' |