summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/T16500
diff options
context:
space:
mode:
authorPhuong Trinh <lolotp@fb.com>2019-03-30 19:00:12 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-04-08 14:35:43 -0400
commit2b3f4718502465e2b4dfa4a7868ed7a3ad5e4ff1 (patch)
treeefa049b8a63f6fee669379b6a09e301ea7da7ec9 /testsuite/tests/driver/T16500
parent63b7d5fb9d695dafc243cbf6f9f70b06030c0dea (diff)
downloadhaskell-2b3f4718502465e2b4dfa4a7868ed7a3ad5e4ff1.tar.gz
Fix #16500: look for interface files in -hidir flag in OneShot mode
We are currently ignoring options set in the hiDir field of hsc_dflags when looking for interface files while compiling in OneShot mode. This is inconsistent with the behaviour of other directory redirecting fields (such as objectDir or hieDir). It is also inconsistent with the behaviour of compilation in CompManager mode (a.k.a `ghc --make`) which looks for interface files in the directory set in hidir flag. This changes Finder.hs so that we use the value of hiDir while looking for interface in OneShot mode.
Diffstat (limited to 'testsuite/tests/driver/T16500')
-rw-r--r--testsuite/tests/driver/T16500/A.hs4
-rw-r--r--testsuite/tests/driver/T16500/B.hs7
-rw-r--r--testsuite/tests/driver/T16500/Makefile12
-rw-r--r--testsuite/tests/driver/T16500/T16500.stdout0
-rw-r--r--testsuite/tests/driver/T16500/all.T1
5 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/driver/T16500/A.hs b/testsuite/tests/driver/T16500/A.hs
new file mode 100644
index 0000000000..9e76b58f67
--- /dev/null
+++ b/testsuite/tests/driver/T16500/A.hs
@@ -0,0 +1,4 @@
+module A (message) where
+
+message :: String
+message = "Hello!!"
diff --git a/testsuite/tests/driver/T16500/B.hs b/testsuite/tests/driver/T16500/B.hs
new file mode 100644
index 0000000000..71de4f0fc9
--- /dev/null
+++ b/testsuite/tests/driver/T16500/B.hs
@@ -0,0 +1,7 @@
+module B where
+
+import A (message)
+
+main :: IO ()
+main = do
+ putStrLn message
diff --git a/testsuite/tests/driver/T16500/Makefile b/testsuite/tests/driver/T16500/Makefile
new file mode 100644
index 0000000000..7cec0ccd24
--- /dev/null
+++ b/testsuite/tests/driver/T16500/Makefile
@@ -0,0 +1,12 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+T16500:
+ $(RM) -rf interfaces objects
+ $(RM) A.hi
+ mkdir -p interfaces
+ mkdir -p objects
+ "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c A.hs -iinterfaces -hidir interfaces -odir objects
+ touch A.hi
+ "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c B.hs -iinterfaces -hidir interfaces -odir objects
diff --git a/testsuite/tests/driver/T16500/T16500.stdout b/testsuite/tests/driver/T16500/T16500.stdout
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/testsuite/tests/driver/T16500/T16500.stdout
diff --git a/testsuite/tests/driver/T16500/all.T b/testsuite/tests/driver/T16500/all.T
new file mode 100644
index 0000000000..ef57f7f25a
--- /dev/null
+++ b/testsuite/tests/driver/T16500/all.T
@@ -0,0 +1 @@
+test('T16500', [extra_files(['A.hs','B.hs',]),], run_command, ['$MAKE -s --no-print-directory T16500'])