diff options
author | Ben Gamari <ben@well-typed.com> | 2022-06-23 12:12:52 -0400 |
---|---|---|
committer | Zubin Duggal <zubin.duggal@gmail.com> | 2022-07-14 14:39:37 +0530 |
commit | 60bce16eb1cdab8eeb23ff0522395647d190e833 (patch) | |
tree | 09e29c5dea538dc8069ca4fed5f2077dce37d275 | |
parent | 110316bc4eee16b7c78ef4d9448c7b1a1eb846d9 (diff) | |
download | haskell-60bce16eb1cdab8eeb23ff0522395647d190e833.tar.gz |
-ddump-llvm shouldn't imply -fllvm
Previously -ddump-llvm would change the backend used, which contrasts
with all other dump flags. This is quite surprising and cost me quite
a bit of time. Dump flags should not change compiler behavior.
Fixes #21776.
(cherry picked from commit df762ae9e2d5263fb71f6df38323ac3ca400cc47)
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 2 | ||||
-rw-r--r-- | testsuite/driver/testlib.py | 3 | ||||
-rw-r--r-- | testsuite/tests/codeGen/should_compile/Makefile | 2 | ||||
-rw-r--r-- | testsuite/tests/codeGen/should_compile/all.T | 3 |
4 files changed, 7 insertions, 3 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 27fad85858..2abff1ad1f 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -2449,7 +2449,7 @@ dynamic_flags_deps = [ , make_ord_flag defGhcFlag "ddump-asm-expanded" (setDumpFlag Opt_D_dump_asm_expanded) , make_ord_flag defGhcFlag "ddump-llvm" - (NoArg $ setObjBackend LLVM >> setDumpFlag' Opt_D_dump_llvm) + (NoArg $ setDumpFlag' Opt_D_dump_llvm) , make_ord_flag defGhcFlag "ddump-c-backend" (NoArg $ setDumpFlag' Opt_D_dump_c_backend) , make_ord_flag defGhcFlag "ddump-deriv" diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 26102772de..8b58084921 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -581,6 +581,9 @@ def have_vanilla( ) -> bool: def have_ncg( ) -> bool: return config.have_ncg +def have_llvm( ) -> bool: + return config.have_llvm + def have_dynamic( ) -> bool: ''' Were libraries built in the dynamic way? ''' return config.have_dynamic diff --git a/testsuite/tests/codeGen/should_compile/Makefile b/testsuite/tests/codeGen/should_compile/Makefile index 448331fc38..775b03f3f1 100644 --- a/testsuite/tests/codeGen/should_compile/Makefile +++ b/testsuite/tests/codeGen/should_compile/Makefile @@ -52,7 +52,7 @@ T15155: # Same as above, but in LLVM. Check that the static indirection b is compiled to # an alias. T15155l: - '$(TEST_HC)' $(TEST_HC_OPTS) -c -O0 -ddump-llvm T15155l.hs 2>/dev/null | \ + '$(TEST_HC)' $(TEST_HC_OPTS) -c -O0 -fllvm -ddump-llvm T15155l.hs 2>/dev/null | \ grep -F "@T15155_b_closure = alias i8, i8* @T15155_a_closure" # Without -fcatch-bottoms `f` is non-CAFFY. With -fcatch-bottoms it becomes diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T index 0e89b1d82c..161bceab69 100644 --- a/testsuite/tests/codeGen/should_compile/all.T +++ b/testsuite/tests/codeGen/should_compile/all.T @@ -54,7 +54,8 @@ test('T15155', [ unless(have_ncg(), skip) ], makefile_test, []) -test('T15155l', when(unregisterised(), skip), +test('T15155l', + [when(unregisterised(), skip), unless(have_llvm(), skip), only_ways(llvm_ways)], makefile_test, []) test('T16449_1', normal, compile, ['']) |