summaryrefslogtreecommitdiff
path: root/testsuite/tests/hpc
diff options
context:
space:
mode:
authorReid Barton <rwbarton@gmail.com>2017-03-25 10:53:29 -0400
committerBen Gamari <ben@smart-cactus.org>2017-03-26 19:28:29 -0400
commit14b46a556dde8a2795ff5ede46ba8ee63368ae93 (patch)
tree626fa3b751ffc03c649bc15cc60871c09016800a /testsuite/tests/hpc
parent43e7b23a472e5decc3fde2fcaf924e0c893b8a64 (diff)
downloadhaskell-14b46a556dde8a2795ff5ede46ba8ee63368ae93.tar.gz
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
Diffstat (limited to 'testsuite/tests/hpc')
-rw-r--r--testsuite/tests/hpc/Makefile6
-rw-r--r--testsuite/tests/hpc/T11798.hs3
-rw-r--r--testsuite/tests/hpc/T11798.stdout2
-rw-r--r--testsuite/tests/hpc/all.T2
4 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/hpc/Makefile b/testsuite/tests/hpc/Makefile
index 9a36a1c5fe..6de7ceefc1 100644
--- a/testsuite/tests/hpc/Makefile
+++ b/testsuite/tests/hpc/Makefile
@@ -1,3 +1,9 @@
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
diff --git a/testsuite/tests/hpc/T11798.hs b/testsuite/tests/hpc/T11798.hs
new file mode 100644
index 0000000000..2d42817259
--- /dev/null
+++ b/testsuite/tests/hpc/T11798.hs
@@ -0,0 +1,3 @@
+module T11798 where
+
+f x = [x,x,x]
diff --git a/testsuite/tests/hpc/T11798.stdout b/testsuite/tests/hpc/T11798.stdout
new file mode 100644
index 0000000000..024b0dcea3
--- /dev/null
+++ b/testsuite/tests/hpc/T11798.stdout
@@ -0,0 +1,2 @@
+[1 of 1] Compiling T11798 ( T11798.hs, T11798.o )
+[1 of 1] Compiling T11798 ( T11798.hs, T11798.o ) [flags changed]
diff --git a/testsuite/tests/hpc/all.T b/testsuite/tests/hpc/all.T
index f1fc590e78..274674b95f 100644
--- a/testsuite/tests/hpc/all.T
+++ b/testsuite/tests/hpc/all.T
@@ -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