diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2022-09-16 14:36:15 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-10-17 19:21:52 -0400 |
commit | ff6275ef829873a70350c6d597e485bb84dd1bb1 (patch) | |
tree | e9837e8ad61c85fd02f7390aac6903751f585699 | |
parent | 08ab5419286d2620f2e6762607bad03c5bcd29ad (diff) | |
download | haskell-ff6275ef829873a70350c6d597e485bb84dd1bb1.tar.gz |
Testsuite: Add a new tables_next_to_code predicate.
And use it to avoid T21710a failing on non-tntc archs.
Fixes #22169
-rw-r--r-- | testsuite/driver/testglobals.py | 2 | ||||
-rw-r--r-- | testsuite/driver/testlib.py | 3 | ||||
-rw-r--r-- | testsuite/ghc-config/ghc-config.hs | 1 | ||||
-rw-r--r-- | testsuite/mk/test.mk | 6 | ||||
-rw-r--r-- | testsuite/tests/codeGen/should_compile/all.T | 5 |
5 files changed, 16 insertions, 1 deletions
diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index 4c5f8d545b..ea0b03b3c1 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -86,6 +86,8 @@ class TestConfig: # What is the wordsize (in bits) of this platform? self.wordsize = '' + # Is tables next to code enabled? + self.tables_next_to_code = True # Verbosity level self.verbose = 2 diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 432b196053..29929892e9 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -569,6 +569,9 @@ def ghc_dynamic() -> bool: def leading_underscore() -> bool: return config.leading_underscore +# TNTC enabled +def tables_next_to_code() -> bool: + return config.tables_next_to_code def fast() -> bool: return config.speed == 2 diff --git a/testsuite/ghc-config/ghc-config.hs b/testsuite/ghc-config/ghc-config.hs index b38401b433..b308cf61d5 100644 --- a/testsuite/ghc-config/ghc-config.hs +++ b/testsuite/ghc-config/ghc-config.hs @@ -30,6 +30,7 @@ main = do getGhcFieldOrDefault fields "GhcDynamic" "GHC Dynamic" "NO" getGhcFieldOrDefault fields "GhcProfiled" "GHC Profiled" "NO" getGhcFieldOrDefault fields "LeadingUnderscore" "Leading underscore" "NO" + getGhcFieldOrDefault fields "GhcTablesNextToCode" "Tables next to code" "NO" getGhcFieldProgWithDefault fields "AR" "ar command" "ar" getGhcFieldProgWithDefault fields "CLANG" "LLVM clang command" "clang" getGhcFieldProgWithDefault fields "LLC" "LLVM llc command" "llc" diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk index 4ce9bbb8a0..201d52d1dd 100644 --- a/testsuite/mk/test.mk +++ b/testsuite/mk/test.mk @@ -96,6 +96,12 @@ else RUNTEST_OPTS += -e "config.leading_underscore=False" endif +ifeq "$(GhcTablesNextToCode)" "YES" +RUNTEST_OPTS += -e "config.tables_next_to_code=True" +else +RUNTEST_OPTS += -e "config.tables_next_to_code=False" +endif + HAVE_GDB := $(shell if gdb --version > /dev/null 2> /dev/null; then echo YES; else echo NO; fi) HAVE_READELF := $(shell if readelf --version > /dev/null 2> /dev/null; then echo YES; else echo NO; fi) diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T index 9569a0e64a..58600faa98 100644 --- a/testsuite/tests/codeGen/should_compile/all.T +++ b/testsuite/tests/codeGen/should_compile/all.T @@ -108,4 +108,7 @@ test('T18614', normal, compile, ['']) test('mk-big-obj', [unless(opsys('mingw32'), skip), pre_cmd('$PYTHON mk-big-obj.py > mk-big-obj.c')], multimod_compile, ['mk-big-obj.c', '-c -v0 -no-hs-main']) -test('T21710a', [ only_ways(['optasm']), when(wordsize(32), skip), grep_errmsg('(call)',[1]) ], compile, ['-ddump-cmm -dno-typeable-binds']) +test('T21710a', [ unless(tables_next_to_code(), skip) , when(wordsize(32), skip) + , only_ways(['optasm']) + , grep_errmsg('(call)',[1]) ] + , compile, ['-ddump-cmm -dno-typeable-binds']) |