[Git][ghc/ghc][wip/T17521] Better tests

Jaro Reinders (@Noughtmare) gitlab at gitlab.haskell.org
Tue Jul 18 08:26:37 UTC 2023



Jaro Reinders pushed to branch wip/T17521 at Glasgow Haskell Compiler / GHC


Commits:
410d3c72 by Jaro Reinders at 2023-07-18T10:26:29+02:00
Better tests

- - - - -


4 changed files:

- testsuite/tests/unlifted-datatypes/should_compile/TopLevel.stderr
- + testsuite/tests/unlifted-datatypes/should_compile/TopLevelSGraf.hs
- testsuite/tests/unlifted-datatypes/should_compile/TopLevela.hs
- testsuite/tests/unlifted-datatypes/should_compile/all.T


Changes:

=====================================
testsuite/tests/unlifted-datatypes/should_compile/TopLevel.stderr
=====================================
@@ -1,18 +1,16 @@
-[1 of 3] Compiling TopLevela        ( TopLevela.hs, TopLevela.o )
 
 ==================== Tidy Core ====================
 Result size of Tidy Core
-  = {terms: 12, types: 6, coercions: 0, joins: 0/0}
+  = {terms: 18, types: 8, coercions: 0, joins: 0/0}
 
-x3 = USucc UZero
+x5 = USucc UZero
+
+x4 = USucc x5
+
+x3 = USucc x4
 
 x2 = USucc x3
 
 x1 = USucc x2
 
 x = Box x1
-
-
-
-[2 of 3] Compiling Main             ( TopLevel.hs, TopLevel.o )
-[3 of 3] Linking TopLevel


=====================================
testsuite/tests/unlifted-datatypes/should_compile/TopLevelSGraf.hs
=====================================
@@ -0,0 +1,22 @@
+{-# LANGUAGE UnliftedDatatypes #-}
+
+module TopLevelSGraf where
+
+import GHC.Exts
+import Data.Kind
+
+type Box :: UnliftedType -> Type
+data Box a = Box a
+type UMaybe :: Type -> UnliftedType
+data UMaybe a = UJust !a | UNothing
+
+y :: Int
+y = sum [0..100]
+{-# OPAQUE y #-}
+
+x :: Box (UMaybe Int)
+x = Box (UJust y)
+{-# OPAQUE x #-}
+
+main = case x of
+  Box (UJust n) -> print n


=====================================
testsuite/tests/unlifted-datatypes/should_compile/TopLevela.hs
=====================================
@@ -11,4 +11,4 @@ data UNat = UZero | USucc UNat
 type Box :: UnliftedType -> Type
 data Box a = Box a
 
-x = Box (USucc (USucc (USucc UZero)))
+x = Box (USucc (USucc (USucc (USucc (USucc UZero)))))


=====================================
testsuite/tests/unlifted-datatypes/should_compile/all.T
=====================================
@@ -2,6 +2,7 @@ test('UnlDataMonoSigs', normal, compile, [''])
 test('UnlDataPolySigs', normal, compile, [''])
 test('UnlDataFams', normal, compile, [''])
 test('UnlDataUsersGuide', normal, compile, [''])
-test('TopLevel', normal, multimod_compile, ['TopLevel', '-O'])
+test('TopLevel', normal, multimod_compile, ['TopLevel', '-O -v0'])
 test('TopLevelStgRewrite', normal, multimod_compile, ['TopLevelStgRewrite', '-v0'])
 test('TopLevelStgRewriteBoot', normal, multimod_compile, ['TopLevelStgRewriteBoot', '-O -v0'])
+test('TopLevelSGraf', normal, compile, ['-O'])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/410d3c727482478a26280f0498379f4cc05650fe

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/410d3c727482478a26280f0498379f4cc05650fe
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/20230718/d291f362/attachment-0001.html>


More information about the ghc-commits mailing list