[Git][ghc/ghc][wip/T17521] Add test

Jaro Reinders (@Noughtmare) gitlab at gitlab.haskell.org
Wed Jul 12 12:16:42 UTC 2023



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


Commits:
2e59dd79 by Jaro Reinders at 2023-07-12T14:16:32+02:00
Add test

- - - - -


4 changed files:

- + testsuite/tests/unlifted-datatypes/should_run/TopLevel.hs
- + testsuite/tests/unlifted-datatypes/should_run/TopLevel.stdout
- + testsuite/tests/unlifted-datatypes/should_run/TopLevela.hs
- testsuite/tests/unlifted-datatypes/should_run/all.T


Changes:

=====================================
testsuite/tests/unlifted-datatypes/should_run/TopLevel.hs
=====================================
@@ -0,0 +1,7 @@
+import TopLevela
+
+toInt UZero = 0
+toInt (USucc x) = 1 + toInt x
+
+main = case x of
+  Box y -> print (toInt y)


=====================================
testsuite/tests/unlifted-datatypes/should_run/TopLevel.stdout
=====================================
@@ -0,0 +1 @@
+3
\ No newline at end of file


=====================================
testsuite/tests/unlifted-datatypes/should_run/TopLevela.hs
=====================================
@@ -0,0 +1,13 @@
+{-# LANGUAGE UnliftedDatatypes #-}
+module TopLevela where
+
+import GHC.Exts (UnliftedType)
+import Data.Kind (Type)
+
+type UNat :: UnliftedType
+data UNat = UZero | USucc UNat
+
+type Box :: UnliftedType -> Type
+data Box a = Box a
+
+x = Box (USucc (USucc (USucc UZero)))


=====================================
testsuite/tests/unlifted-datatypes/should_run/all.T
=====================================
@@ -1,3 +1,4 @@
 test('UnlData1', normal, compile_and_run, [''])
 test('UnlGadt1', [exit_code(1), expect_broken_for(23060, ghci_ways)], compile_and_run, [''])
 test('T23549', normal, multimod_compile_and_run, ['T23549', ''])
+test('TopLevel', normal, multimod_compile_and_run, ['TopLevel', '-O'])
\ No newline at end of file



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2e59dd7947ae0da96da5b60ff7d3042ae7cd54de

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2e59dd7947ae0da96da5b60ff7d3042ae7cd54de
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/20230712/324efed8/attachment-0001.html>


More information about the ghc-commits mailing list