summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-03-18 20:08:08 +0100
committerThomas Miedema <thomasmiedema@gmail.com>2015-12-24 19:52:22 +0100
commit48db13d279d592ed3044cbaf3513854bcb0d3dce (patch)
treefecc90166a269f14b76687a5472fee34ad305c7b /testsuite/tests
parente33837677fc4d1d9bd6fdad4e9fd8c61a639f52e (diff)
downloadhaskell-48db13d279d592ed3044cbaf3513854bcb0d3dce.tar.gz
Don't drop last char of file if -osuf contains dot
Given: * `file = "foo.a.b"` * `osuf = ".a.b"` -- Note the initial dot. * `new_osuf = "c"` Before (bad, the last character of the filename is dropped): `dropTail (length osuf + 1) file <.> new_osuf == "fo.c"` After (good): `stripExtension osuf file <.> new_osuf` == "foo.c" This regression was introduced in commit c489af73 (#5554). That commit fixed a similar but different bug, and care has been taken to not reintroduce it (using the the newly introduced `System.Filepath.stripExtension`). Given: * `file = "foo.a.b"` * `osuf = "a.b"` * `new_osuf = "c"` Before c489af73 (bad, the full suffix should get replaced): `replaceExtension file new_osuf == "foo.a.c"` After c489af73 (good): `dropTail (length osuf + 1) file <.> new_osuf == "foo.c"` After this commit (still good): `stripExtension osuf file <.> new_osuf == "foo.c"` Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1692 GHC Trac Issues: #9760
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/th/Makefile6
-rw-r--r--testsuite/tests/th/all.T2
2 files changed, 6 insertions, 2 deletions
diff --git a/testsuite/tests/th/Makefile b/testsuite/tests/th/Makefile
index b759a81b67..4fb508f394 100644
--- a/testsuite/tests/th/Makefile
+++ b/testsuite/tests/th/Makefile
@@ -15,9 +15,11 @@ T7445:
HC_OPTS = -XTemplateHaskell -package template-haskell
TH_spliceE5_prof::
- $(RM) TH_spliceE5_prof*.o TH_spliceE5_prof*.hi TH_spliceE5_prof*.p.o
+ $(RM) TH_spliceE5_prof*.o TH_spliceE5_prof*.hi TH_spliceE5_prof*.dyn_o TH_spliceE5_prof*.dyn_hi TH_spliceE5_prof
'$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) $(ghcThWayFlags) --make -v0 TH_spliceE5_prof.hs -c
- '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -auto-all -osuf p.o -o $@
+ # Using `-osuf .p.o` should work. Note the dot before the `p` (#9760), and
+ # the dot between the `p` and the `o` (#5554).
+ '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -auto-all -osuf .p.o -o $@
./$@
# With -fexternal-interpreter, we don't have to build the non-profiled
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index 9d00d8e856..fb429bcbd5 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -47,6 +47,8 @@ test('TH_spliceE5_prof',
[req_profiling,
omit_ways(['ghci']),
extra_clean(['TH_spliceE5_prof_Lib.p.o', 'TH_spliceE5_prof_Lib.hi',
+ 'TH_spliceE5_prof_Lib.dyn_o', 'TH_spliceE5_prof_Lib.dyn_hi',
+ 'TH_spliceE5_prof.dyn_o', 'TH_spliceE5_prof.dyn_hi',
'TH_spliceE5_prof_Lib.o','TH_spliceE5_prof.p.o'])],
run_command,
['$MAKE -s --no-print-directory TH_spliceE5_prof'])