From 2b3f4718502465e2b4dfa4a7868ed7a3ad5e4ff1 Mon Sep 17 00:00:00 2001 From: Phuong Trinh Date: Sat, 30 Mar 2019 19:00:12 +0000 Subject: 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. --- testsuite/tests/driver/T16500/A.hs | 4 ++++ testsuite/tests/driver/T16500/B.hs | 7 +++++++ testsuite/tests/driver/T16500/Makefile | 12 ++++++++++++ testsuite/tests/driver/T16500/T16500.stdout | 0 testsuite/tests/driver/T16500/all.T | 1 + 5 files changed, 24 insertions(+) create mode 100644 testsuite/tests/driver/T16500/A.hs create mode 100644 testsuite/tests/driver/T16500/B.hs create mode 100644 testsuite/tests/driver/T16500/Makefile create mode 100644 testsuite/tests/driver/T16500/T16500.stdout create mode 100644 testsuite/tests/driver/T16500/all.T (limited to 'testsuite/tests/driver') 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 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']) -- cgit v1.2.1