aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Foo.hs5
-rw-r--r--Main.hs10
-rw-r--r--README.md21
-rw-r--r--repro.cabal15
5 files changed, 52 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c33954f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+dist-newstyle/
diff --git a/Foo.hs b/Foo.hs
new file mode 100644
index 0000000..6bbd254
--- /dev/null
+++ b/Foo.hs
@@ -0,0 +1,5 @@
+module Foo where
+
+
+foo :: Int -> Int
+foo x = x + 1
diff --git a/Main.hs b/Main.hs
new file mode 100644
index 0000000..1285d32
--- /dev/null
+++ b/Main.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE TemplateHaskell #-}
+module Main where
+
+import Language.Haskell.TH
+
+import Foo
+
+main :: IO ()
+main = do
+ putStrLn $(return $ LitE (StringL (show (foo 42))))
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..9ca98e8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,21 @@
+```
+$ cabal clean
+
+$ cabal run --enable-profiling
+Resolving dependencies...
+Build profile: -w ghc-9.4.7 -O1
+In order, the following will be built (use -v for more details):
+ - repro-0.1.0.0 (exe:test) --enable-profiling (first run)
+Configuring executable 'test' for repro-0.1.0.0..
+Preprocessing executable 'test' for repro-0.1.0.0..
+Building executable 'test' for repro-0.1.0.0..
+[1 of 2] Compiling Foo ( Foo.hs, /home/tom/code/ghc-prof-dyn-repro/dist-newstyle/build/x86_64-linux/ghc-9.4.7/repro-0.1.0.0/x/test/build/test/test-tmp/Foo.p_o )
+[2 of 2] Compiling Main ( Main.hs, /home/tom/code/ghc-prof-dyn-repro/dist-newstyle/build/x86_64-linux/ghc-9.4.7/repro-0.1.0.0/x/test/build/test/test-tmp/Main.p_o )
+
+<no location info>: error:
+ Main.hs:10:12: fatal:
+ cannot find object file ‘/home/tom/code/ghc-prof-dyn-repro/dist-newstyle/build/x86_64-linux/ghc-9.4.7/repro-0.1.0.0/x/test/build/test/test-tmp/Foo.dyn_o’
+ while linking an interpreted expression
+
+$
+```
diff --git a/repro.cabal b/repro.cabal
new file mode 100644
index 0000000..86ba3e7
--- /dev/null
+++ b/repro.cabal
@@ -0,0 +1,15 @@
+cabal-version: 1.12
+name: repro
+version: 0.1.0.0
+author: Tom Smeding
+copyright: 2022 Tom Smeding
+license: MIT
+build-type: Simple
+
+executable test
+ main-is: Main.hs
+ other-modules: Foo
+ hs-source-dirs: .
+ ghc-options: -Wall -O2 -threaded -rtsopts
+ build-depends: base, template-haskell
+ default-language: Haskell2010