On Fri, 21 Sep 2018 at 22:47, Mike Stump <[email protected]> wrote:
>
> On Sep 17, 2018, at 5:37 PM, Iain Buclaw <[email protected]> wrote:
> >
> > This patch adds a further number of tests, but were added as part of
> > fixing gdc-specific bugs.
>
> Ok. Trivial, and self-review applicable.
Attaching Dejagnu file changes to support what was done in 08/14.
Regards
--
Iain
---
diff --git a/gcc/testsuite/gdc.test/d_do_test.exp b/gcc/testsuite/gdc.test/d_do_test.exp
index a3c49165bbd..246ac850a20 100644
--- a/gcc/testsuite/gdc.test/d_do_test.exp
+++ b/gcc/testsuite/gdc.test/d_do_test.exp
@@ -22,16 +22,16 @@ load_lib gdc-dg.exp
# Convert DMD arguments to GDC equivalent
#
-proc gdc-convert-args { base args } {
+proc gdc-convert-args { args } {
set out ""
foreach arg [split [lindex $args 0] " "] {
# List of switches kept in ASCII collated order.
if { [regexp -- {^-I([\w+/-]+)} $arg pattern path] } {
- lappend out "-I$base/$path"
+ lappend out "-I$path"
} elseif { [regexp -- {^-J([\w+/-]+)} $arg pattern path] } {
- lappend out "-J$base/$path"
+ lappend out "-J$path"
} elseif [string match "-allinst" $arg] {
lappend out "-fall-instantiations"
@@ -158,6 +158,9 @@ proc gdc-copy-extra { base extra } {
#
# COMPILE_SEPARATELY: Not handled.
# EXECUTE_ARGS: Parameters to add to the execution of the test.
+# COMPILED_IMPORTS: List of modules files that are imported by the main
+# source file that should be included in compilation.
+# Currently handled the same as EXTRA_SOURCES.
# EXTRA_SOURCES: List of extra sources to build and link along with
# the test.
# EXTRA_FILES: List of extra files to copy for the test runs.
@@ -207,7 +210,7 @@ proc dmd2dg { base test } {
} elseif [regexp -- {PERMUTE_ARGS\s*:\s*(.*)} $copy_line match args] {
# PERMUTE_ARGS is handled by gdc-do-test.
- set PERMUTE_ARGS [gdc-convert-args $base $args]
+ set PERMUTE_ARGS [gdc-convert-args $args]
regsub -- {PERMUTE_ARGS.*$} $copy_line "" out_line
} elseif [regexp -- {EXECUTE_ARGS\s*:\s*(.*)} $copy_line match args] {
@@ -219,7 +222,7 @@ proc dmd2dg { base test } {
} elseif [regexp -- {REQUIRED_ARGS\s*:\s*(.*)} $copy_line match args] {
# Convert all listed arguments to from dmd to gdc-style.
- set new_option "{ dg-additional-options \"[gdc-convert-args $base $args]\" }"
+ set new_option "{ dg-additional-options \"[gdc-convert-args $args]\" }"
regsub -- {REQUIRED_ARGS.*$} $copy_line $new_option out_line
} elseif [regexp -- {EXTRA_SOURCES\s*:\s*(.*)} $copy_line match sources] {
@@ -241,7 +244,7 @@ proc dmd2dg { base test } {
regsub -- {EXTRA_CPP_SOURCES.*$} $copy_line $new_option out_line
} elseif [regexp -- {EXTRA_FILES\s*:\s*(.*)} $copy_line match files] {
- # Copy all sources to the testsuite build directory.
+ # Copy all files to the testsuite build directory.
foreach import $files {
# print "Import: $base $type/$import"
gdc-copy-extra $base "$type/$import"
@@ -249,6 +252,15 @@ proc dmd2dg { base test } {
set new_option "{ dg-additional-files \"$files\" }"
regsub -- {EXTRA_FILES.*$} $copy_line $new_option out_line
+ } elseif [regexp -- {COMPILED_IMPORTS\s*:\s*(.*)} $copy_line match sources] {
+ # Copy all sources to the testsuite build directory.
+ foreach import $sources {
+ # print "Import: $base $type/$import"
+ gdc-copy-extra $base "$type/$import"
+ }
+ set new_option "{ dg-additional-sources \"$sources\" }"
+ regsub -- {COMPILED_IMPORTS.*$} $copy_line $new_option out_line
+
}
puts $fdout $out_line