Commit 14b46a55 authored by rwbarton's avatar rwbarton Committed by Ben Gamari
Browse files

Recompile if -fhpc is added or removed (#11798)

Test Plan: validate

Reviewers: austin, bgamari, dfeuer

Reviewed By: dfeuer

Subscribers: dfeuer, thomie

Differential Revision: https://phabricator.haskell.org/D3368
parent 43e7b23a
......@@ -57,9 +57,15 @@ fingerprintDynFlags dflags@DynFlags{..} this_mod nameio =
then 0
else optLevel
in -- pprTrace "flags" (ppr (mainis, safeHs, lang, cpp, paths, prof, opt)) $
computeFingerprint nameio (mainis, safeHs, lang, cpp, paths, prof, opt)
-- -fhpc, see https://ghc.haskell.org/trac/ghc/ticket/11798
-- hpcDir is output-only, so we should recompile if it changes
hpc = if gopt Opt_Hpc dflags then Just hpcDir else Nothing
-- Nesting just to avoid ever more Binary tuple instances
flags = (mainis, safeHs, lang, cpp, paths, (prof, opt, hpc))
in -- pprTrace "flags" (ppr flags) $
computeFingerprint nameio flags
{- Note [path flags and recompilation]
......
TOP=../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
# Test that adding -fhpc triggers recompilation
T11798:
"$(TEST_HC)" $(TEST_HC_ARGS) T11798
"$(TEST_HC)" $(TEST_HC_ARGS) T11798 -fhpc
test -e .hpc/T11798.mix
module T11798 where
f x = [x,x,x]
[1 of 1] Compiling T11798 ( T11798.hs, T11798.o )
[1 of 1] Compiling T11798 ( T11798.hs, T11798.o ) [flags changed]
......@@ -3,6 +3,8 @@ test('T10138', [extra_files(['.keepme.hpc.T10138/']),
# Using --hpcdir with an absolute path should work (exit code 0).
['{hpc} report T10138.keepme.tix --hpcdir="`pwd`/.keepme.hpc.T10138"'])
test('T11798', normal, run_command, ['$MAKE -s --no-print-directory T11798'])
# Run tests below only for the hpc way.
#
# Do not explicitly specify '-fhpc' in extra_hc_opts, unless also setting
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment