Commit ad567778 authored by Simon Marlow's avatar Simon Marlow

add an old ForeignPtr stress test I found in my tree

parent b5439484
......@@ -137,6 +137,7 @@ test('2594', omit_ways(['ghci']), compile_and_run, ['2594_c.c'])
test('fptr01', [ omit_ways(['ghci']), extra_clean(['fptr01_c.o']) ],
compile_and_run, ['fptr01_c.c'])
test('fptr02', normal, compile_and_run, [''])
test('fptrfail01', [ compose(omit_ways(['ghci']), exit_code(1)),
extra_clean(['fptrfail01_c.o']) ],
{-# LANGUAGE ForeignFunctionInterface #-}
module Main where
import Foreign
import Control.Monad
foreign import ccall "&free" pfree :: FunPtr (Ptr a -> IO ())
main = replicateM_ 1000000 $ newForeignPtr pfree nullPtr
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