testsuite: Add test for #14346
authorSylvain Henry <hsyl20@gmail.com>
Tue, 31 Jul 2018 15:02:20 +0000 (11:02 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 31 Jul 2018 15:48:19 +0000 (11:48 -0400)
testsuite/tests/codeGen/should_run/T14346.hs [new file with mode: 0644]
testsuite/tests/codeGen/should_run/all.T

diff --git a/testsuite/tests/codeGen/should_run/T14346.hs b/testsuite/tests/codeGen/should_run/T14346.hs
new file mode 100644 (file)
index 0000000..b61b92b
--- /dev/null
@@ -0,0 +1,21 @@
+module Main where
+
+import Control.Concurrent
+import Control.Monad
+import Data.Word
+import Foreign.Marshal.Alloc
+import Foreign.Storable
+import Numeric
+import GHC.Ptr
+
+main :: IO ()
+main = do
+    replicateM_ 49 $ threadDelay 1
+    _ <- forkIO $ do
+       allocaBytes 4 $ \p -> do
+         forever $ do
+           poke p (0xDEADBEEF :: Word32)
+           threadDelay 10
+           x <- peek p
+           unless (x == 0xDEADBEEF) $ putStrLn (showHex x "")
+    threadDelay 1000000
index 2495c1d..60f86d7 100644 (file)
@@ -171,3 +171,4 @@ test('T13825-unit',
      ['-package ghc'])
 test('T14619', normal, compile_and_run, [''])
 test('T14754', normal, compile_and_run, [''])
+test('T14346', only_ways(['threaded1','threaded2']), compile_and_run, ['-O -threaded'])