summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-09-30 21:55:08 +0100
committerIan Lynagh <igloo@earth.li>2011-09-30 23:52:56 +0100
commitf1b395c221a37861ee417d9239e711aa5e11c870 (patch)
tree750c3ec04f95f346bd142214bf41ecdf04f04336 /testsuite
parent1e3708f48a42ad4e7e3d7df5ee38a7d6fd63e64f (diff)
downloadhaskell-f1b395c221a37861ee417d9239e711aa5e11c870.tar.gz
Add a couple more cases to ccfail004
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/ffi/should_fail/ccfail004.hs8
-rw-r--r--testsuite/tests/ffi/should_fail/ccfail004.stderr16
2 files changed, 20 insertions, 4 deletions
diff --git a/testsuite/tests/ffi/should_fail/ccfail004.hs b/testsuite/tests/ffi/should_fail/ccfail004.hs
index 5676d7c324..1773e2e030 100644
--- a/testsuite/tests/ffi/should_fail/ccfail004.hs
+++ b/testsuite/tests/ffi/should_fail/ccfail004.hs
@@ -3,8 +3,14 @@ module Ccfail004 where
import Ccfail004A
--- Both these should be rejected as the NInt constructor isn't in scope
+newtype NT = NT [NT]
+
+-- All these should be rejected as the newtype constructors aren't in scope
foreign import ccall f1 :: NInt -> IO Int
foreign import ccall f2 :: Int -> IO NInt
foreign import ccall f3 :: Int -> NIO Int
+-- Both these should be rejected as NT is recursive
+foreign import ccall f4 :: NT -> IO ()
+foreign import ccall f5 :: IO NT
+
diff --git a/testsuite/tests/ffi/should_fail/ccfail004.stderr b/testsuite/tests/ffi/should_fail/ccfail004.stderr
index 08e3f4fdb5..cabda4e7d1 100644
--- a/testsuite/tests/ffi/should_fail/ccfail004.stderr
+++ b/testsuite/tests/ffi/should_fail/ccfail004.stderr
@@ -1,16 +1,26 @@
-ccfail004.hs:7:1:
+ccfail004.hs:9:1:
Unacceptable argument type in foreign declaration: NInt
When checking declaration:
foreign import ccall safe "static f1" f1 :: NInt -> IO Int
-ccfail004.hs:8:1:
+ccfail004.hs:10:1:
Unacceptable result type in foreign declaration: IO NInt
When checking declaration:
foreign import ccall safe "static f2" f2 :: Int -> IO NInt
-ccfail004.hs:9:1:
+ccfail004.hs:11:1:
Unacceptable result type in foreign declaration: NIO Int
When checking declaration:
foreign import ccall safe "static f3" f3 :: Int -> NIO Int
+ccfail004.hs:14:1:
+ Unacceptable argument type in foreign declaration: [NT]
+ When checking declaration:
+ foreign import ccall safe "static f4" f4 :: NT -> IO ()
+
+ccfail004.hs:15:1:
+ Unacceptable result type in foreign declaration: IO [NT]
+ When checking declaration:
+ foreign import ccall safe "static f5" f5 :: IO NT
+