From 818760d68c0e5e4479a4f64fc863303ff5f23a3a Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Thu, 1 Sep 2016 15:28:07 -0700 Subject: Fix #10923 by fingerprinting optimization level. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: simonmar, austin, bgamari, thomie, rwbarton Differential Revision: https://phabricator.haskell.org/D2509 GHC Trac Issues: #10923 --- testsuite/tests/driver/Makefile | 7 +++++++ testsuite/tests/driver/T10923.hs | 1 + testsuite/tests/driver/all.T | 7 ++++++- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 testsuite/tests/driver/T10923.hs (limited to 'testsuite/tests') diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile index 8069331fcb..4e9ef20f41 100644 --- a/testsuite/tests/driver/Makefile +++ b/testsuite/tests/driver/Makefile @@ -629,3 +629,10 @@ T12135: cp T12135b.h T12135b/T12135.h "$(TEST_HC)" $(TEST_HC_OPTS) -IT12135b -IT12135a --make T12135.hs ./T12135 + +.PHONY: T10923 +T10923: + $(RM) -rf T10923.o T10923.hi + "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O0 -c T10923.hs + # should NOT output "compilation is NOT required" + "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O -c T10923.hs diff --git a/testsuite/tests/driver/T10923.hs b/testsuite/tests/driver/T10923.hs new file mode 100644 index 0000000000..8e2ddcd93f --- /dev/null +++ b/testsuite/tests/driver/T10923.hs @@ -0,0 +1 @@ +module T10923 where diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index ebd1b5af7f..c6283df156 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -491,4 +491,9 @@ test('T12135', run_command, ['$MAKE -s --no-print-directory T12135']) -test('T12192', normal, run_command, ['mkdir foo && (cd foo && {compiler} -v0 ../T12192)']) \ No newline at end of file +test('T12192', normal, run_command, ['mkdir foo && (cd foo && {compiler} -v0 ../T12192)']) + +test('T10923', + extra_clean(['T10923.o', 'T10923.hi']), + run_command, + ['$MAKE -s --no-print-directory T10923']) -- cgit v1.2.1