summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'])