summaryrefslogtreecommitdiff
path: root/gcc/testsuite/lib
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-03-25 09:38:58 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2020-04-18 18:25:49 +0200
commit261bd78d57d40a03f340cfe4fc78ff9717c9602d (patch)
tree56918700689bbafd55af340a13d15c94ac5831fe /gcc/testsuite/lib
parentbaf3b9b2e5259558ef86bd62398e2ccecd7a4a4c (diff)
libphobos: Add --with-libphobos-druntime-only option.
The intended purpose of the option is both for targets that don't support phobos yet, and for gdc itself to support bootstrapping itself as a self-hosted D compiler. The libphobos testsuite has been updated to only add libphobos to the search paths if it's being built. A new D2 testsuite directive RUNNABLE_PHOBOS_TEST has also been patched in to disable some runnable tests that have phobos dependencies, of which is a temporary measure until upstream DMD fixes or removes these tests entirely. gcc/testsuite/ChangeLog: * lib/gdc-utils.exp (gdc-convert-test): Add dg-skip-if for tests that depending on the phobos standard library. libphobos/ChangeLog: * configure: Regenerate. * configure.ac: Add --with-libphobos-druntime-only option and the conditional ENABLE_LIBDRUNTIME_ONLY. * configure.tgt: Define LIBDRUNTIME_ONLY. * src/Makefile.am: Add phobos sources if not ENABLE_LIBDRUNTIME_ONLY. * src/Makefile.in: Regenerate. * testsuite/testsuite_flags.in: Add phobos path if compiling phobos.
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r--gcc/testsuite/lib/gdc-utils.exp9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/gdc-utils.exp b/gcc/testsuite/lib/gdc-utils.exp
index 31a4cf0b5e2..87d1105a9db 100644
--- a/gcc/testsuite/lib/gdc-utils.exp
+++ b/gcc/testsuite/lib/gdc-utils.exp
@@ -208,6 +208,7 @@ proc gdc-convert-test { base test } {
set extra_sources ""
set extra_files ""
+ set needs_phobos 0
upvar 1 compilable_do_what compilable_do_what
set compilable_output_file_ext ""
@@ -296,6 +297,11 @@ proc gdc-convert-test { base test } {
}
regsub -- {COMPILED_IMPORTS.*$} $copy_line "" out_line
+ } elseif [regexp -- {RUNNABLE_PHOBOS_TEST} $copy_line match sources] {
+ # RUNNABLE_PHOBOS_TEST annotates tests that import the std module.
+ # It will need skipping if phobos is not available on the target.
+ regsub -- {RUNNABLE_PHOBOS_TEST.*$} $copy_line "" out_line
+ set needs_phobos 1
}
puts $fdout $out_line
@@ -331,6 +337,9 @@ proc gdc-convert-test { base test } {
if ![isnative] {
puts $fdout "// { dg-final { output-exists } }"
}
+ if $needs_phobos {
+ puts $fdout "// { dg-skip-if \"imports phobos\" { ! d_runtime_has_std_library } }"
+ }
}
compilable {