summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2019-02-11 17:39:02 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-02-14 02:29:54 -0500
commit0f1eb88c93143359fa671bb72aceebc299c87a95 (patch)
tree0de2726584ebe2b5cb81fd94aab1f3f76de92eb8
parent7f26b74e409d058005909fc2b2ed2e6027d49365 (diff)
downloadhaskell-0f1eb88c93143359fa671bb72aceebc299c87a95.tar.gz
Add perf test for #16190
-rw-r--r--testsuite/tests/perf/compiler/T16190.hs17
-rw-r--r--testsuite/tests/perf/compiler/T16190_Embed.hs7
-rw-r--r--testsuite/tests/perf/compiler/all.T6
3 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/tests/perf/compiler/T16190.hs b/testsuite/tests/perf/compiler/T16190.hs
new file mode 100644
index 0000000000..79479f022d
--- /dev/null
+++ b/testsuite/tests/perf/compiler/T16190.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module Main where
+
+import T16190_Embed
+import Foreign.Ptr
+import Foreign.Storable
+import Data.Word
+import GHC.Ptr
+
+ptr :: Ptr Word32
+ptr = Ptr $(embedBytes (replicate (3 * 1000 * 1000) 0x37))
+
+main :: IO ()
+main = do
+ w <- peek (ptr `plusPtr` 12)
+ print (w == (0x37373737 :: Word32))
diff --git a/testsuite/tests/perf/compiler/T16190_Embed.hs b/testsuite/tests/perf/compiler/T16190_Embed.hs
new file mode 100644
index 0000000000..f7e50d64bf
--- /dev/null
+++ b/testsuite/tests/perf/compiler/T16190_Embed.hs
@@ -0,0 +1,7 @@
+module T16190_Embed where
+
+import Data.Word
+import Language.Haskell.TH
+
+embedBytes :: [Word8] -> Q Exp
+embedBytes bs = return (LitE (StringPrimL bs))
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index 91037199be..82847c2e56 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -390,3 +390,9 @@ test ('T15164',
],
compile,
['-v0 -O'])
+
+test('T16190',
+ [ collect_stats()
+ ],
+ multimod_compile,
+ ['T16190.hs', '-v0'])