From f1b395c221a37861ee417d9239e711aa5e11c870 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 30 Sep 2011 21:55:08 +0100 Subject: Add a couple more cases to ccfail004 --- testsuite/tests/ffi/should_fail/ccfail004.hs | 8 +++++++- testsuite/tests/ffi/should_fail/ccfail004.stderr | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'testsuite') 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 + -- cgit v1.2.1