diff --git a/testsuite/tests/stranal/sigs/T6070.hs b/testsuite/tests/stranal/sigs/T6070.hs new file mode 100644 index 0000000000000000000000000000000000000000..7eb679fa5262b38b910d4d9f22371a1eb7cf04bd --- /dev/null +++ b/testsuite/tests/stranal/sigs/T6070.hs @@ -0,0 +1,13 @@ +module T6070 where + +import qualified Data.Map as M + +-- Should unbox `x`, so signature 1!P(..,..) +h :: (Int, Int) -> Int -> (Int, Int) +h x y = if y > 10 + then x + else h (case h x 0 of (y1, y2) -> (y2, y1)) (y + 1) + +-- Should unbox `(a,b)`, so signature 1!P(..,..) +c :: M.Map Int Int -> (Int, Int) +c m = M.foldrWithKey (\k v (a, b) -> if k + v > 2 then (a, b) else (b, a)) (0, 1) m diff --git a/testsuite/tests/stranal/sigs/T6070.stderr b/testsuite/tests/stranal/sigs/T6070.stderr new file mode 100644 index 0000000000000000000000000000000000000000..891cf6c8d699b17d4f38e7b813a1194cc9857335 --- /dev/null +++ b/testsuite/tests/stranal/sigs/T6070.stderr @@ -0,0 +1,18 @@ + +==================== Strictness signatures ==================== +T6070.c: <1L> +T6070.h: <1!P(L,L)><1!P(L)> + + + +==================== Cpr signatures ==================== +T6070.c: 1 +T6070.h: 1 + + + +==================== Strictness signatures ==================== +T6070.c: <1L> +T6070.h: <1!P(L,L)><1!P(L)> + + diff --git a/testsuite/tests/stranal/sigs/all.T b/testsuite/tests/stranal/sigs/all.T index 3392f931c19792ce03ab3b0b66f970aa87923e2c..bef6797b7d2ec1b683d12d09a73ca67bac461c86 100644 --- a/testsuite/tests/stranal/sigs/all.T +++ b/testsuite/tests/stranal/sigs/all.T @@ -18,6 +18,7 @@ test('DmdAnalGADTs', normal, compile, ['']) test('T12370', normal, compile, ['']) test('NewtypeArity', normal, compile, ['']) test('T5075', normal, compile, ['']) +test('T6070', normal, compile, ['']) test('T17932', normal, compile, ['']) test('T13380c', expect_broken('!3014'), compile, ['']) test('T13380f', normal, compile, [''])