summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver
diff options
context:
space:
mode:
authorDavid Feuer <david.feuer@gmail.com>2017-12-11 13:03:52 -0500
committerBen Gamari <ben@smart-cactus.org>2017-12-11 13:03:53 -0500
commit708ed9ca4dbf372817fe84a2fe486940123bddfb (patch)
tree30d67b789552b9f017674d4e9f2b6341cc75eede /testsuite/tests/driver
parentcafe98345cb5d4b11f2059d60d2f20e976ef4f2a (diff)
downloadhaskell-708ed9ca4dbf372817fe84a2fe486940123bddfb.tar.gz
Allow users to ignore optimization changes
* Add a new flag, `-fignore-optim-changes`, allowing them to avoid recompilation if the only changes are to the `-O` level or to flags controlling optimizations. * When `-fignore-optim-changes` is *off*, recompile when optimization flags (e.g., `-fno-full-laziness`) change. Previously, we ignored these unconditionally when deciding whether to recompile a module. Reviewers: austin, bgamari, simonmar Reviewed By: simonmar Subscribers: duog, carter, simonmar, rwbarton, thomie GHC Trac Issues: #13604 Differential Revision: https://phabricator.haskell.org/D4123
Diffstat (limited to 'testsuite/tests/driver')
-rw-r--r--testsuite/tests/driver/Makefile14
-rw-r--r--testsuite/tests/driver/T13604.hs1
-rw-r--r--testsuite/tests/driver/T13604.stdout1
-rw-r--r--testsuite/tests/driver/T13604a.hs1
-rw-r--r--testsuite/tests/driver/T13604a.stdout1
-rw-r--r--testsuite/tests/driver/T13914/T13914.stdout4
-rw-r--r--testsuite/tests/driver/all.T2
7 files changed, 22 insertions, 2 deletions
diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile
index ffb924adb5..727cc44940 100644
--- a/testsuite/tests/driver/Makefile
+++ b/testsuite/tests/driver/Makefile
@@ -637,6 +637,20 @@ T10923:
# should NOT output "compilation is NOT required"
"$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O -c T10923.hs
+.PHONY: T13604
+T13604:
+ $(RM) -rf T13604.o T13604.hi
+ "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O0 -c T13604.hs
+ # SHOULD output "compilation is NOT required"
+ "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O -c -fignore-optim-changes T13604.hs
+
+.PHONY: T13604a
+T13604a:
+ $(RM) -rf T13604a.o T13604a.hi
+ "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O0 -c -fhpc T13604a.hs
+ # SHOULD output "compilation is NOT required"
+ "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O0 -c -fignore-hpc-changes T13604a.hs
+
.PHONY: T12955
T12955:
! "$(TEST_HC)" $(TEST_HC_OPTS) --make T12955
diff --git a/testsuite/tests/driver/T13604.hs b/testsuite/tests/driver/T13604.hs
new file mode 100644
index 0000000000..d98fb588ab
--- /dev/null
+++ b/testsuite/tests/driver/T13604.hs
@@ -0,0 +1 @@
+module T13604 where
diff --git a/testsuite/tests/driver/T13604.stdout b/testsuite/tests/driver/T13604.stdout
new file mode 100644
index 0000000000..ae02c1f7a8
--- /dev/null
+++ b/testsuite/tests/driver/T13604.stdout
@@ -0,0 +1 @@
+compilation IS NOT required
diff --git a/testsuite/tests/driver/T13604a.hs b/testsuite/tests/driver/T13604a.hs
new file mode 100644
index 0000000000..ea79324743
--- /dev/null
+++ b/testsuite/tests/driver/T13604a.hs
@@ -0,0 +1 @@
+module T13604a where
diff --git a/testsuite/tests/driver/T13604a.stdout b/testsuite/tests/driver/T13604a.stdout
new file mode 100644
index 0000000000..ae02c1f7a8
--- /dev/null
+++ b/testsuite/tests/driver/T13604a.stdout
@@ -0,0 +1 @@
+compilation IS NOT required
diff --git a/testsuite/tests/driver/T13914/T13914.stdout b/testsuite/tests/driver/T13914/T13914.stdout
index 04d14aa293..d443ed47b9 100644
--- a/testsuite/tests/driver/T13914/T13914.stdout
+++ b/testsuite/tests/driver/T13914/T13914.stdout
@@ -5,11 +5,11 @@ main: Assertion failed
CallStack (from HasCallStack):
assert, called at main.hs:3:8 in main:Main
With -fignore-asserts
-[1 of 1] Compiling Main ( main.hs, main.o ) [flags changed]
+[1 of 1] Compiling Main ( main.hs, main.o ) [Optimisation flags changed]
Linking main ...
OK
Without -fignore-asserts
-[1 of 1] Compiling Main ( main.hs, main.o ) [flags changed]
+[1 of 1] Compiling Main ( main.hs, main.o ) [Optimisation flags changed]
Linking main ...
main: Assertion failed
CallStack (from HasCallStack):
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 19dcc0a950..a63513a671 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -271,3 +271,5 @@ test('T12955', normal, run_command, ['$MAKE -s --no-print-directory T12955'])
test('T12971', ignore_stdout, run_command, ['$MAKE -s --no-print-directory T12971'])
test('json', normal, compile_fail, ['-ddump-json'])
test('json2', normal, compile, ['-ddump-types -ddump-json'])
+test('T13604', [], run_command, ['$MAKE -s --no-print-directory T13604'])
+test('T13604a', [], run_command, ['$MAKE -s --no-print-directory T13604a'])