summaryrefslogtreecommitdiff
path: root/testsuite/tests/unlifted-datatypes/should_run/UnlGadt1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/unlifted-datatypes/should_run/UnlGadt1.hs')
-rw-r--r--testsuite/tests/unlifted-datatypes/should_run/UnlGadt1.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/unlifted-datatypes/should_run/UnlGadt1.hs b/testsuite/tests/unlifted-datatypes/should_run/UnlGadt1.hs
new file mode 100644
index 0000000000..ed19c3236f
--- /dev/null
+++ b/testsuite/tests/unlifted-datatypes/should_run/UnlGadt1.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE UnliftedDatatypes #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE KindSignatures #-}
+
+import GHC.Exts
+import GHC.Types
+
+data T a :: UnliftedType where
+ TInt :: T Int
+
+f :: T a -> Int
+f _ = 0
+
+g :: T a -> T a
+g TInt = TInt
+{-# NOINLINE g #-}
+
+main = do
+ case g TInt of TInt -> putStrLn "should see this"
+ print (f (error "boom")) -- crashes!