summaryrefslogtreecommitdiff
path: root/testsuite/tests/esc/TestImport.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/esc/TestImport.hs')
-rw-r--r--testsuite/tests/esc/TestImport.hs27
1 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/esc/TestImport.hs b/testsuite/tests/esc/TestImport.hs
new file mode 100644
index 0000000000..bf91eafb63
--- /dev/null
+++ b/testsuite/tests/esc/TestImport.hs
@@ -0,0 +1,27 @@
+module TestImport where
+
+import TestList
+
+{-# CONTRACT t2 :: _ #-}
+t2 = head1 [True] -- same as TestList res2
+
+{-# CONTRACT t3 :: {x | True} #-}
+t3 = head1 [True] -- same as TestList.res3
+
+t4 = head1 [] -- same as TestList.res4
+
+t5 = head1 [True] -- same as TestList.res5
+
+t2a = res2
+t3a = res3
+t4a = res4
+t5a = res5
+
+{-# CONTRACT tail1 :: {xs | not1 (null1 xs)} -> {r | True} #-}
+tail1 :: [Int] -> [Int]
+tail1 (x:xs) = xs
+
+{-# CONTRACT tail2 :: {xs | not (null xs)} -> {r | True} #-}
+tail2 :: [Int] -> [Int]
+tail2 (x:xs) = xs
+