summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-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