diff options
Diffstat (limited to 'testsuite/tests/lib/should_run/stableptr005.hs')
-rw-r--r-- | testsuite/tests/lib/should_run/stableptr005.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/lib/should_run/stableptr005.hs b/testsuite/tests/lib/should_run/stableptr005.hs new file mode 100644 index 0000000000..dc4928ab6c --- /dev/null +++ b/testsuite/tests/lib/should_run/stableptr005.hs @@ -0,0 +1,22 @@ +-- !!! triggered a temporary bug in freeStablePtr around 20020424 + +module Main where +import Foreign.StablePtr (newStablePtr, freeStablePtr) + +data Foo = A | B | C | D + +main :: IO () +main = do aSPtr <- newStablePtr A + bSPtr <- newStablePtr B + cSPtr <- newStablePtr C + cSPtr' <- newStablePtr C + freeStablePtr aSPtr + freeStablePtr bSPtr + freeStablePtr cSPtr + freeStablePtr cSPtr' + aSPtr <- newStablePtr A + bSPtr <- newStablePtr B + cSPtr <- newStablePtr C + dSPtr <- newStablePtr D + print "Hello World" + |