aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2018-11-25 15:59:44 +0000
committerRainer Orth <ro@gcc.gnu.org>2018-11-25 15:59:44 +0000
commit6d9434e5954ef5a450a8bd3fd3c3961545bc1d9c (patch)
treea4f51aa030bb3c975492679820efdc63e6d5607b /gcc
parent12422bc85c33040992711bd0c2afe55672206341 (diff)
downloadgcc-6d9434e5954ef5a450a8bd3fd3c3961545bc1d9c.zip
gcc-6d9434e5954ef5a450a8bd3fd3c3961545bc1d9c.tar.gz
gcc-6d9434e5954ef5a450a8bd3fd3c3961545bc1d9c.tar.bz2
Disable gdc execution tests without libphobos
gcc/testsuite: * lib/target-supports.exp (check_compile): Handle D. (check_effective_target_d_runtime): New proc. * lib/gdc-dg.exp (gdc-dg-test): Demote link and run tests to compile unless d_runtime. * gdc.dg/runnable.d: Skip unless d_runtime. * gdc.dg/lto/lto.exp: Require d_runtime to run tests. gcc: * doc/sourcebuild.texi (Effective-Target Keywords, Environment attributes): Document d_runtime. From-SVN: r266438
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/doc/sourcebuild.texi3
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/gdc.dg/lto/lto.exp5
-rw-r--r--gcc/testsuite/gdc.dg/runnable.d1
-rw-r--r--gcc/testsuite/lib/gdc-dg.exp13
-rw-r--r--gcc/testsuite/lib/target-supports.exp15
7 files changed, 51 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2bff937..343ea38 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * doc/sourcebuild.texi (Effective-Target Keywords, Environment
+ attributes): Document d_runtime.
+
2018-11-25 Vladimir Makarov <vmakarov@redhat.com>
PR bootstrap/88157
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 3fdf5e3..77349415 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2106,6 +2106,9 @@ Target provides a full C99 runtime.
Target @code{string.h} and @code{wchar.h} headers provide C++ required
overloads for @code{strchr} etc. functions.
+@item d_runtime
+Target provides the D runtime.
+
@item dummy_wcsftime
Target uses a dummy @code{wcsftime} function that always returns zero.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e761b2c..5a4b5a2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2018-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * lib/target-supports.exp (check_compile): Handle D.
+ (check_effective_target_d_runtime): New proc.
+ * lib/gdc-dg.exp (gdc-dg-test): Demote link and run tests to
+ compile unless d_runtime.
+ * gdc.dg/runnable.d: Skip unless d_runtime.
+ * gdc.dg/lto/lto.exp: Require d_runtime to run tests.
+
2018-11-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/88143
diff --git a/gcc/testsuite/gdc.dg/lto/lto.exp b/gcc/testsuite/gdc.dg/lto/lto.exp
index 1fed9cd..9df69cf 100644
--- a/gcc/testsuite/gdc.dg/lto/lto.exp
+++ b/gcc/testsuite/gdc.dg/lto/lto.exp
@@ -36,6 +36,11 @@ if { ![check_effective_target_lto] } {
return
}
+# Likewise if the D runtime library is missing.
+if { ![check_effective_target_d_runtime] } {
+ return
+}
+
lto_init no-mathlib
# Define an identifier for use with this suite to avoid name conflicts
diff --git a/gcc/testsuite/gdc.dg/runnable.d b/gcc/testsuite/gdc.dg/runnable.d
index 4f1ef76..ec172fa 100644
--- a/gcc/testsuite/gdc.dg/runnable.d
+++ b/gcc/testsuite/gdc.dg/runnable.d
@@ -1,5 +1,6 @@
// { dg-additional-sources "imports/runnable.d" }
// { dg-do run { target hw } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
module runnable;
diff --git a/gcc/testsuite/lib/gdc-dg.exp b/gcc/testsuite/lib/gdc-dg.exp
index e5d9f1d..6767259 100644
--- a/gcc/testsuite/lib/gdc-dg.exp
+++ b/gcc/testsuite/lib/gdc-dg.exp
@@ -19,6 +19,19 @@ load_lib gcc-dg.exp
# Define gdc callbacks for dg.exp.
proc gdc-dg-test { prog do_what extra_tool_flags } {
+ upvar dg-do-what dg-do-what
+
+ # Demote link and run tests to compile-only if D runtime is missing.
+ if ![check_effective_target_d_runtime] {
+ switch $do_what {
+ link -
+ run {
+ set do_what compile
+ set dg-do-what compile
+ }
+ }
+ }
+
set result \
[gcc-dg-test-1 gdc_target_compile $prog $do_what $extra_tool_flags]
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index c2a9447..37791cf 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -31,6 +31,7 @@
# Assume by default that CONTENTS is C code.
# Otherwise, code should contain:
# "// C++" for c++,
+# "// D" for D,
# "! Fortran" for Fortran code,
# "/* ObjC", for ObjC
# "// ObjC++" for ObjC++
@@ -58,6 +59,7 @@ proc check_compile {basename type contents args} {
switch -glob -- $contents {
"*! Fortran*" { set src ${basename}[pid].f90 }
"*// C++*" { set src ${basename}[pid].cc }
+ "*// D*" { set src ${basename}[pid].d }
"*// ObjC++*" { set src ${basename}[pid].mm }
"*/* ObjC*" { set src ${basename}[pid].m }
"*// Go*" { set src ${basename}[pid].go }
@@ -7154,6 +7156,19 @@ proc check_effective_target_c99_runtime { } {
}]
}
+# Return 1 if the target provides the D runtime.
+
+proc check_effective_target_d_runtime { } {
+ return [check_no_compiler_messages d_runtime executable {
+ // D
+ module mod;
+
+ extern(C) int main() {
+ return 0;
+ }
+ }]
+}
+
# Return 1 if target wchar_t is at least 4 bytes.
proc check_effective_target_4byte_wchar_t { } {