Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: ef652c33 by Sylvain Henry at 2026-11-30T04:14:36-05:00 testsuite: Do not pass $(WAY_FLAGS) to GHCi in Makefile tests (#28166) Since 543c108e6a9 the driver sets WAY_FLAGS for Makefile tests. Some GHCi tests passed $(WAY_FLAGS) to ghc --interactive, where it was empty before. In the optasm and optllvm ways it now contains -O, and the byte-code backend ignores -O with a -Winconsistent-flags warning. This warning made the tests fail. Pass $(WAY_FLAGS) to the compilation steps only. GHCi reuses the object files that these steps make with -O, thus the tests stay useful in the optimised ways. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - - - - - 6 changed files: - testsuite/tests/ghci/prog-mhu005/Makefile - testsuite/tests/ghci/prog-mhu006/Makefile - testsuite/tests/ghci/prog-mhu007/Makefile - testsuite/tests/ghci/prog020/Makefile - testsuite/tests/ghci/prog022/Makefile - testsuite/tests/ghci/prog025/Makefile Changes: ===================================== testsuite/tests/ghci/prog-mhu005/Makefile ===================================== @@ -4,28 +4,28 @@ include $(TOP)/mk/test.mk .PHONY: prog-mhu005a prog-mhu005a: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fno-load-initial-targets -unit @unitA -unit @unitB < prog-mhu005a.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fno-load-initial-targets -unit @unitA -unit @unitB < prog-mhu005a.script .PHONY: prog-mhu005b prog-mhu005b: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fimport-loaded-targets -unit @unitA -unit @unitB < prog-mhu005b.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fimport-loaded-targets -unit @unitA -unit @unitB < prog-mhu005b.script .PHONY: prog-mhu005c prog-mhu005c: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fno-import-loaded-targets -unit @unitA -unit @unitB < prog-mhu005c.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fno-import-loaded-targets -unit @unitA -unit @unitB < prog-mhu005c.script .PHONY: prog-mhu005d prog-mhu005d: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fno-load-initial-targets -fno-import-loaded-targets -unit @unitA -unit @unitB < prog-mhu005d.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fno-load-initial-targets -fno-import-loaded-targets -unit @unitA -unit @unitB < prog-mhu005d.script .PHONY: prog-mhu005e prog-mhu005e: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fno-load-initial-targets -fimport-loaded-targets -unit @unitA -unit @unitB < prog-mhu005e.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fno-load-initial-targets -fimport-loaded-targets -unit @unitA -unit @unitB < prog-mhu005e.script .PHONY: prog-mhu005f prog-mhu005f: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -unit @unitA -unit @unitB < prog-mhu005f.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -unit @unitA -unit @unitB < prog-mhu005f.script .PHONY: prog-mhu005g prog-mhu005g: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fno-load-initial-targets -fimport-loaded-targets -unit @unitA -unit @unitB < prog-mhu005g.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fno-load-initial-targets -fimport-loaded-targets -unit @unitA -unit @unitB < prog-mhu005g.script ===================================== testsuite/tests/ghci/prog-mhu006/Makefile ===================================== @@ -4,6 +4,6 @@ include $(TOP)/mk/test.mk .PHONY: prog-mhu006a prog-mhu006a: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) \ + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) \ -no-user-package-db \ -unit @unitA -unit @unitB < prog-mhu006a.script ===================================== testsuite/tests/ghci/prog-mhu007/Makefile ===================================== @@ -29,5 +29,5 @@ prog-mhu007: $(LOCAL_GHC_PKG_BAR) hide testpkg-bar $(LOCAL_GHC_PKG_BAR) list - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) \ + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) \ -no-user-package-db -fno-code -unit @unitA -unit @unitB < prog-mhu007.script ===================================== testsuite/tests/ghci/prog020/Makefile ===================================== @@ -5,9 +5,9 @@ include $(TOP)/mk/test.mk .PHONY: ghci.prog020a ghci.prog020a: '$(TEST_HC)' $(TEST_HC_OPTS) $(WAY_FLAGS) $(ghciWayFlags) -v0 A.hs B.hs - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -i -i. A B < ghci.prog020a.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -i -i. A B < ghci.prog020a.script .PHONY: ghci.prog020b ghci.prog020b: '$(TEST_HC)' $(TEST_HC_OPTS) $(WAY_FLAGS) $(ghciWayFlags) -v0 A.hs B.hs - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -i -i. A B < ghci.prog020b.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -i -i. A B < ghci.prog020b.script ===================================== testsuite/tests/ghci/prog022/Makefile ===================================== @@ -4,24 +4,24 @@ include $(TOP)/mk/test.mk .PHONY: ghci.prog022a ghci.prog022a: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fno-load-initial-targets -i -i. A B < ghci.prog022a.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fno-load-initial-targets -i -i. A B < ghci.prog022a.script .PHONY: ghci.prog022b ghci.prog022b: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fno-load-initial-targets -i -i. A B < ghci.prog022b.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fno-load-initial-targets -i -i. A B < ghci.prog022b.script .PHONY: ghci.prog022c ghci.prog022c: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fimport-loaded-targets -i -i. A B < ghci.prog022c.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fimport-loaded-targets -i -i. A B < ghci.prog022c.script .PHONY: ghci.prog022d ghci.prog022d: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fno-load-initial-targets -fimport-loaded-targets -i -i. A B < ghci.prog022d.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fno-load-initial-targets -fimport-loaded-targets -i -i. A B < ghci.prog022d.script .PHONY: ghci.prog022e ghci.prog022e: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fimport-loaded-targets -i -i. A B < ghci.prog022e.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fimport-loaded-targets -i -i. A B < ghci.prog022e.script .PHONY: ghci.prog022f ghci.prog022f: - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) -v0 -fno-load-initial-targets -fimport-loaded-targets -i -i. A B < ghci.prog022f.script + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) -v0 -fno-load-initial-targets -fimport-loaded-targets -i -i. A B < ghci.prog022f.script ===================================== testsuite/tests/ghci/prog025/Makefile ===================================== @@ -26,7 +26,7 @@ prog025a: $(LOCAL_GHC_PKG01) hide testpkg-0.2.0.0 $(LOCAL_GHC_PKG01) list - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) \ + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) \ -no-user-package-db -fno-code -unit @unitA < prog025a.script # Same as prog025a, but the home unit arguments are not provided using a response file @@ -49,6 +49,6 @@ prog025b: $(LOCAL_GHC_PKG01) list # Uses response file for argument, doesn't use it as a -unit argument - '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) \ + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghciWayFlags) \ -no-user-package-db -fno-code \ @unitA < prog025b.script View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ef652c33e77f61e93dedb7ca15607d18... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ef652c33e77f61e93dedb7ca15607d18... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help