diff options
-rw-r--r-- | compiler/iface/FlagChecker.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/driver/T13914/Makefile | 16 | ||||
-rw-r--r-- | testsuite/tests/driver/T13914/T13914.stdout | 16 | ||||
-rw-r--r-- | testsuite/tests/driver/T13914/all.T | 4 | ||||
-rw-r--r-- | testsuite/tests/driver/T13914/main.hs | 3 |
5 files changed, 44 insertions, 1 deletions
diff --git a/compiler/iface/FlagChecker.hs b/compiler/iface/FlagChecker.hs index 2c0b6c4367..fd0459d6cc 100644 --- a/compiler/iface/FlagChecker.hs +++ b/compiler/iface/FlagChecker.hs @@ -61,8 +61,12 @@ fingerprintDynFlags dflags@DynFlags{..} this_mod nameio = -- hpcDir is output-only, so we should recompile if it changes hpc = if gopt Opt_Hpc dflags then Just hpcDir else Nothing + -- -fignore-asserts, which affects how `Control.Exception.assert` works + ignore_asserts = gopt Opt_IgnoreAsserts dflags + -- Nesting just to avoid ever more Binary tuple instances - flags = (mainis, safeHs, lang, cpp, paths, (prof, opt, hpc)) + flags = (mainis, safeHs, lang, cpp, paths, + (prof, opt, hpc, ignore_asserts)) in -- pprTrace "flags" (ppr flags) $ computeFingerprint nameio flags diff --git a/testsuite/tests/driver/T13914/Makefile b/testsuite/tests/driver/T13914/Makefile new file mode 100644 index 0000000000..764942cf4c --- /dev/null +++ b/testsuite/tests/driver/T13914/Makefile @@ -0,0 +1,16 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +t13914: + echo "Without -fignore-asserts" + '$(TEST_HC)' $(TEST_HC_OPTS) main.hs + (./main 2>&1); true + sleep 1 + echo "With -fignore-asserts" + '$(TEST_HC)' $(TEST_HC_OPTS) -fignore-asserts main.hs + ./main 2>&1 + sleep 1 + echo "Without -fignore-asserts" + '$(TEST_HC)' $(TEST_HC_OPTS) main.hs + (./main 2>&1); true diff --git a/testsuite/tests/driver/T13914/T13914.stdout b/testsuite/tests/driver/T13914/T13914.stdout new file mode 100644 index 0000000000..04d14aa293 --- /dev/null +++ b/testsuite/tests/driver/T13914/T13914.stdout @@ -0,0 +1,16 @@ +Without -fignore-asserts +[1 of 1] Compiling Main ( main.hs, main.o ) +Linking main ... +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] +Linking main ... +OK +Without -fignore-asserts +[1 of 1] Compiling Main ( main.hs, main.o ) [flags changed] +Linking main ... +main: Assertion failed +CallStack (from HasCallStack): + assert, called at main.hs:3:8 in main:Main diff --git a/testsuite/tests/driver/T13914/all.T b/testsuite/tests/driver/T13914/all.T new file mode 100644 index 0000000000..2e6a952e57 --- /dev/null +++ b/testsuite/tests/driver/T13914/all.T @@ -0,0 +1,4 @@ +test('T13914', + [extra_files(['main.hs'])], + run_command, + ['$MAKE -s --no-print-directory t13914']) diff --git a/testsuite/tests/driver/T13914/main.hs b/testsuite/tests/driver/T13914/main.hs new file mode 100644 index 0000000000..859f3e6473 --- /dev/null +++ b/testsuite/tests/driver/T13914/main.hs @@ -0,0 +1,3 @@ +import Control.Exception (assert) + +main = assert False (putStrLn "OK") |