Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/2b68468cfa085826006e97c89e4d7671735d5c22

>---------------------------------------------------------------

commit 2b68468cfa085826006e97c89e4d7671735d5c22
Author: Ian Lynagh <[email protected]>
Date:   Sun Feb 26 12:49:48 2012 +0000

    Add a test for a "value" FFI import with a function type

>---------------------------------------------------------------

 tests/ffi/should_fail/all.T                      |    1 +
 tests/ffi/should_fail/capi_value_function.hs     |    9 +++++++++
 tests/ffi/should_fail/capi_value_function.stderr |    6 ++++++
 3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/tests/ffi/should_fail/all.T b/tests/ffi/should_fail/all.T
index ca79a89..188ef99 100644
--- a/tests/ffi/should_fail/all.T
+++ b/tests/ffi/should_fail/all.T
@@ -9,3 +9,4 @@ test('T3066', only_compiler_types(['ghc']), compile_fail, [''])
 test('ccfail004', only_compiler_types(['ghc']), multimod_compile_fail, 
['ccfail004', '-v0'])
 test('ccfail005', only_compiler_types(['ghc']), compile_fail, [''])
 test('ccall_value', normal, compile_fail, [''])
+test('capi_value_function', normal, compile_fail, [''])
diff --git a/tests/ffi/should_fail/capi_value_function.hs 
b/tests/ffi/should_fail/capi_value_function.hs
new file mode 100644
index 0000000..fdd5980
--- /dev/null
+++ b/tests/ffi/should_fail/capi_value_function.hs
@@ -0,0 +1,9 @@
+
+{-# LANGUAGE CApiFFI #-}
+
+module M where
+
+import Foreign.C
+
+foreign import capi "math.h value sqrt" f :: CInt -> CInt
+
diff --git a/tests/ffi/should_fail/capi_value_function.stderr 
b/tests/ffi/should_fail/capi_value_function.stderr
new file mode 100644
index 0000000..99ffad6
--- /dev/null
+++ b/tests/ffi/should_fail/capi_value_function.stderr
@@ -0,0 +1,6 @@
+
+capi_value_function.hs:8:1:
+    `value' imports cannot have function types
+    When checking declaration:
+      foreign import capi safe "static math.h value sqrt" f
+        :: CInt -> CInt



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to