diff options
author | Ian Lynagh <igloo@earth.li> | 2012-02-26 01:00:59 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-02-26 01:00:59 +0000 |
commit | ead65bbe1658a97e2aa7bb76cf39e30d46593d82 (patch) | |
tree | baea0e2fe2473e738044e73906c2ccb80389edf3 /testsuite/tests | |
parent | aedcb2184d9c4195e6c1775456a88e593c42211b (diff) | |
download | haskell-ead65bbe1658a97e2aa7bb76cf39e30d46593d82.tar.gz |
Add a test that you can't import "value"s using ccall
"value"s can only be imported using capi.
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/ffi/should_fail/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/ffi/should_fail/ccall_value.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/ffi/should_fail/ccall_value.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/ffi/should_fail/ccall_value_c.h | 3 |
4 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/ffi/should_fail/all.T b/testsuite/tests/ffi/should_fail/all.T index abba1b5f6f..ca79a89d9d 100644 --- a/testsuite/tests/ffi/should_fail/all.T +++ b/testsuite/tests/ffi/should_fail/all.T @@ -8,3 +8,4 @@ test('ccfail003', only_compiler_types(['ghc']), compile_fail, ['']) 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, ['']) diff --git a/testsuite/tests/ffi/should_fail/ccall_value.hs b/testsuite/tests/ffi/should_fail/ccall_value.hs new file mode 100644 index 0000000000..2f931f697b --- /dev/null +++ b/testsuite/tests/ffi/should_fail/ccall_value.hs @@ -0,0 +1,12 @@ + +{-# LANGUAGE CApiFFI #-} + +module Main (main) where + +import Foreign.C + +main :: IO () +main = print i + +foreign import ccall "ccall_value_c.h value i" i :: CInt + diff --git a/testsuite/tests/ffi/should_fail/ccall_value.stderr b/testsuite/tests/ffi/should_fail/ccall_value.stderr new file mode 100644 index 0000000000..b7e870f0ed --- /dev/null +++ b/testsuite/tests/ffi/should_fail/ccall_value.stderr @@ -0,0 +1,2 @@ + +ccall_value.hs:11:22: Malformed entity string diff --git a/testsuite/tests/ffi/should_fail/ccall_value_c.h b/testsuite/tests/ffi/should_fail/ccall_value_c.h new file mode 100644 index 0000000000..d8ef814216 --- /dev/null +++ b/testsuite/tests/ffi/should_fail/ccall_value_c.h @@ -0,0 +1,3 @@ + +const int i; +#define j 24 |