[commit: ghc] master: testsuite: Add test for #14346 (f8e5da9)

git at git.haskell.org git at git.haskell.org
Tue Jul 31 15:49:41 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f8e5da92c0160a675e1666a5d6ed6a8ffcae193c/ghc

>---------------------------------------------------------------

commit f8e5da92c0160a675e1666a5d6ed6a8ffcae193c
Author: Sylvain Henry <hsyl20 at gmail.com>
Date:   Tue Jul 31 11:02:20 2018 -0400

    testsuite: Add test for #14346


>---------------------------------------------------------------

f8e5da92c0160a675e1666a5d6ed6a8ffcae193c
 testsuite/tests/codeGen/should_run/T14346.hs | 21 +++++++++++++++++++++
 testsuite/tests/codeGen/should_run/all.T     |  1 +
 2 files changed, 22 insertions(+)

diff --git a/testsuite/tests/codeGen/should_run/T14346.hs b/testsuite/tests/codeGen/should_run/T14346.hs
new file mode 100644
index 0000000..b61b92b
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T14346.hs
@@ -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
diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T
index 2495c1d..60f86d7 100644
--- a/testsuite/tests/codeGen/should_run/all.T
+++ b/testsuite/tests/codeGen/should_run/all.T
@@ -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'])



More information about the ghc-commits mailing list