Commit 8daa2464 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #7506

parent 8cd4ced5
module Foo where
import Foreign.Ptr
-- foreign import ccall "stdio.h &putchar" c_putchar :: () -> FunPtr (Char -> IO ())
foreign import ccall "stdio.h &putchar" c_putchar :: Int -> IO ()
Unacceptable type in foreign declaration: Int -> IO ()
A foreign-imported address (via &foo) must have type (Ptr a) or (FunPtr a)
When checking declaration:
foreign import ccall safe "static stdio.h &putchar" c_putchar
:: Int -> IO ()
......@@ -11,3 +11,4 @@ test('ccfail005', only_compiler_types(['ghc']), compile_fail, [''])
test('ccall_value', normal, compile_fail, [''])
test('capi_value_function', normal, compile_fail, [''])
test('T5664', normal, compile_fail, ['-v0'])
test('T7506', normal, compile_fail, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment