[Git][ghc/ghc][wip/marge_bot_batch_merge_job] Add regression test for #6070

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Mon Nov 20 15:32:31 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
63211fe4 by Sebastian Graf at 2023-11-20T10:32:27-05:00
Add regression test for #6070

Fixes #6070.

- - - - -


3 changed files:

- + testsuite/tests/stranal/sigs/T6070.hs
- + testsuite/tests/stranal/sigs/T6070.stderr
- testsuite/tests/stranal/sigs/all.T


Changes:

=====================================
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


=====================================
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)>
+
+


=====================================
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, [''])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/63211fe4e45ac5d648fd378cc632f9c489740160

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/63211fe4e45ac5d648fd378cc632f9c489740160
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231120/51894704/attachment-0001.html>


More information about the ghc-commits mailing list