summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2020-10-22 12:08:34 +0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-05 10:29:57 -0400
commit3b1aa7dba7c006b473855a6b199b15fa3a3d77a0 (patch)
tree631816f4aef8d28ee596b51b70a0a0ba2df12230 /testsuite
parent8c90e6c758769b068aea2891b26cc17577b6d36a (diff)
downloadhaskell-3b1aa7dba7c006b473855a6b199b15fa3a3d77a0.tar.gz
Adds AArch64 Native Code Generator
In which we add a new code generator to the Glasgow Haskell Compiler. This codegen supports ELF and Mach-O targets, thus covering Linux, macOS, and BSDs in principle. It was tested only on macOS and Linux. The NCG follows a similar structure as the other native code generators we already have, and should therfore be realtively easy to follow. It supports most of the features required for a proper native code generator, but does not claim to be perfect or fully optimised. There are still opportunities for optimisations. Metric Decrease: ManyAlternatives ManyConstructors MultiLayerModules PmSeriesG PmSeriesS PmSeriesT PmSeriesV T10421 T10421a T10858 T11195 T11276 T11303b T11374 T11822 T12227 T12545 T12707 T13035 T13253 T13253-spj T13379 T13701 T13719 T14683 T14697 T15164 T15630 T16577 T17096 T17516 T17836 T17836b T17977 T17977b T18140 T18282 T18304 T18478 T18698a T18698b T18923 T1969 T3064 T5030 T5321FD T5321Fun T5631 T5642 T5837 T783 T9198 T9233 T9630 T9872d T9961 WWRec Metric Increase: T4801
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/ghci/linking/all.T6
-rw-r--r--testsuite/tests/llvm/should_compile/all.T16
-rw-r--r--testsuite/tests/llvm/should_run/subsections_via_symbols/all.T8
-rw-r--r--testsuite/tests/rts/all.T1
4 files changed, 26 insertions, 5 deletions
diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T
index 1739129a6a..5802c907c2 100644
--- a/testsuite/tests/ghci/linking/all.T
+++ b/testsuite/tests/ghci/linking/all.T
@@ -14,6 +14,9 @@ test('ghcilink003',
[ unless(doing_ghci, skip),
# libstdc++ is GCC-specific on FreeBSD. FreeBSD has libc++ though.
when(opsys('freebsd'), fragile(17739)),
+ # from Big Sur onwards, we can't dlopen libstdc++.dylib
+ # anymore. Will produce:
+ # dlopen(libstdc++.dylib, 5): image not found
when(opsys('darwin'), fragile(16083))
], makefile_test, ['ghcilink003'])
@@ -34,6 +37,9 @@ test('ghcilink006',
[ unless(doing_ghci, skip),
# libstdc++ is GCC-specific on FreeBSD. FreeBSD has libc++ though.
when(opsys('freebsd'), fragile(17739)),
+ # from Big Sur onwards, we can't dlopen libstdc++.dylib
+ # anymore. Will produce:
+ # dlopen(libstdc++.dylib, 5): image not found
when(opsys('darwin'), fragile(16083))
], makefile_test, ['ghcilink006'])
diff --git a/testsuite/tests/llvm/should_compile/all.T b/testsuite/tests/llvm/should_compile/all.T
index dca858dec8..4fb98dac7b 100644
--- a/testsuite/tests/llvm/should_compile/all.T
+++ b/testsuite/tests/llvm/should_compile/all.T
@@ -5,11 +5,19 @@ def f( name, opts ):
setTestOpts(f)
+# Apples LLVM Toolchain knows about a `vortex` cpu (and possibly others), that
+# the stock LLVM toolchain doesn't know abotu and will warn about. Let's not
+# have test fail just because of processor name differences due to different
+# LLVM Toolchains. GHC tries to pass what apple expects (on darwin), but can
+# be used with the stock LLVM toolchain as well.
+def ignore_llvm_and_vortex( msg ):
+ return re.sub(r".* is not a recognized processor for this target.*\n",r"",msg)
+
# test('T5486', normal, compile, [''])
-test('T5681', normal, compile, [''])
+test('T5681', [normal, normalise_errmsg_fun(ignore_llvm_and_vortex)], compile, [''])
test('T6158', [reqlib('vector'), reqlib('primitive')], compile, ['-package vector -package primitive'])
-test('T7571', cmm_src, compile, ['-no-hs-main'])
+test('T7571', [cmm_src, normalise_errmsg_fun(ignore_llvm_and_vortex)], compile, ['-no-hs-main'])
test('T7575', unless(wordsize(32), skip), compile, [''])
-test('T8131b', normal, compile, [''])
-test('T11649', normal, compile, [''])
+test('T8131b', [normal, normalise_errmsg_fun(ignore_llvm_and_vortex)], compile, [''])
+test('T11649', [normal, normalise_errmsg_fun(ignore_llvm_and_vortex)], compile, [''])
test('T17920fail', cmm_src, compile_fail, ['-no-hs-main'])
diff --git a/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T b/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T
index 16a30e6f0f..22d7cb2b42 100644
--- a/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T
+++ b/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T
@@ -3,9 +3,15 @@
#
# Please refer to https://gitlab.haskell.org/ghc/ghc/issues/5019
# for the subsections_via_symbols.stderr
+def ignore_llvm_and_vortex( msg ):
+ return re.sub(r"You are using an unsupported version of LLVM!.*\n",r"",
+ re.sub(r"Currently only [^ ]* is supported. System LLVM version: .*\n", r"",
+ re.sub(r"We will try though.*\n",r"",
+ re.sub(r".* is not a recognized processor for this target.*\n",r"",msg))))
test('subsections_via_symbols',
[when(not opsys('darwin'), skip),
only_ways(['optllvm', 'llvm', 'debugllvm']),
- extra_files(['SubsectionsViaSymbols.hs'])],
+ extra_files(['SubsectionsViaSymbols.hs']),
+ normalise_errmsg_fun(ignore_llvm_and_vortex)],
makefile_test, [])
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index 085e4b1f12..cd4a92dd7b 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -37,6 +37,7 @@ test('derefnull',
# The output under OS X is too unstable to readily compare
when(platform('i386-apple-darwin'), [ignore_stderr, exit_code(139)]),
when(platform('x86_64-apple-darwin'), [ignore_stderr, exit_code(139)]),
+ when(platform('aarch64-apple-darwin'), [ignore_stderr, exit_code(139)]),
when(opsys('mingw32'), [ignore_stderr, exit_code(11)]),
when(opsys('mingw32'), [fragile(18548)]),
# ThreadSanitizer changes the output