Re: [PATCH v2 9/13] D: D2 Testsuite Dejagnu files.

2017-08-01 Thread Mike Stump
On Jun 24, 2017, at 10:52 AM, Iain Buclaw  wrote:
> Added a few extra comments for procedures, altering dmd2dg to write
> out flags converted to dejagnu in-place, instead on newlines.
> 
> In the other testsuite patch, added new tests to accompany fixes that
> have been made since the last patch.

Ok.  From here on out, you can self-approve the usual and customary testsuite 
changes as you become maintainer for the front-end.

If you want any extra testsuite reviews, you can always ask.

Re: [PATCH v2 9/13] D: D2 Testsuite Dejagnu files.

2017-06-26 Thread Mike Stump
On Jun 24, 2017, at 10:52 AM, Iain Buclaw  wrote:
> 
> On 28 May 2017 at 23:16, Iain Buclaw  wrote:
>> This patch adds D language support to the GCC testsuite.
>> 
>> As well as generating the DejaGNU options for compile and link tests,
>> handles the conversion from DMD-style compiler options to GDC.
>> 
>> ---
> 
> Added a few extra comments for procedures, altering dmd2dg to write
> out flags converted to dejagnu in-place, instead on newlines.
> 
> In the other testsuite patch, added new tests to accompany fixes that
> have been made since the last patch.

Ok.


[PATCH v2 9/13] D: D2 Testsuite Dejagnu files.

2017-06-24 Thread Iain Buclaw
On 28 May 2017 at 23:16, Iain Buclaw  wrote:
> This patch adds D language support to the GCC testsuite.
>
> As well as generating the DejaGNU options for compile and link tests,
> handles the conversion from DMD-style compiler options to GDC.
>
> ---

Added a few extra comments for procedures, altering dmd2dg to write
out flags converted to dejagnu in-place, instead on newlines.

In the other testsuite patch, added new tests to accompany fixes that
have been made since the last patch.

Regards
Iain.

---
diff --git a/gcc/testsuite/gdc.test/d_do_test.exp b/gcc/testsuite/gdc.test/d_do_test.exp
new file mode 100644
index 000..7a9da72037e
--- /dev/null
+++ b/gcc/testsuite/gdc.test/d_do_test.exp
@@ -0,0 +1,385 @@
+#   Copyright (C) 2012-2017 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# .
+
+# Test using the DMD testsuite.
+# Load support procs.
+load_lib gdc-dg.exp
+
+#
+# Convert DMD arguments to GDC equivalent
+#
+
+proc gdc-convert-args { base 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"
+
+} elseif { [regexp -- {^-J([\w+/-]+)} $arg pattern path] } {
+lappend out "-J$base/$path"
+
+} elseif [string match "-allinst" $arg] {
+lappend out "-fall-instantiations"
+
+} elseif { [string match "-boundscheck" $arg]
+ || [string match "-boundscheck=on" $arg] } {
+lappend out "-fbounds-check"
+
+} elseif { [string match "-boundscheck=off" $arg]
+   || [string match "-noboundscheck" $arg] } {
+lappend out "-fno-bounds-check"
+
+} elseif [string match "-boundscheck=safeonly" $arg] {
+lappend out "-fbounds-check=safeonly"
+
+} elseif [string match "-c" $arg] {
+lappend out "-c"
+
+} elseif [string match "-d" $arg] {
+lappend out "-Wno-deprecated"
+
+} elseif [string match "-de" $arg] {
+lappend out "-Wdeprecated"
+lappend out "-Werror"
+
+} elseif [string match "-debug" $arg] {
+lappend out "-fdebug"
+
+} elseif [string match "-dip1000" $arg] {
+lappend out "-ftransition=safe"
+
+} elseif [string match "-dip25" $arg] {
+lappend out "-ftransition=dip25"
+
+} elseif [string match "-dw" $arg] {
+lappend out "-Wdeprecated"
+lappend out "-Wno-error"
+
+} elseif [string match "-fPIC" $arg] {
+lappend out "-fPIC"
+
+} elseif { [string match "-g" $arg]
+   || [string match "-gc" $arg] } {
+lappend out "-g"
+
+} elseif [string match "-inline" $arg] {
+lappend out "-finline-functions"
+
+} elseif [regexp -- {^-mv=([\w+=./-]+)} $arg pattern value] {
+lappend out "-fmodule-filepath=$value"
+
+} elseif [string match "-O" $arg] {
+lappend out "-O2"
+
+} elseif [string match "-property" $arg] {
+lappend out "-fproperty"
+
+} elseif [string match "-release" $arg] {
+lappend out "-frelease"
+
+} elseif [regexp -- {^-transition=(\w+)} $arg pattern value] {
+lappend out "-ftransition=$value"
+
+} elseif [string match "-unittest" $arg] {
+lappend out "-funittest"
+
+} elseif [string match "-verrors=spec" $arg] {
+lappend out "-Wspeculative"
+
+} elseif [regexp -- {^-verrors=(\d+)} $arg pattern num] {
+lappend out "-fmax-errors=$num"
+
+} elseif [regexp -- {^-version=(\w+)} $arg pattern value] {
+lappend out "-fversion=$value"
+
+} elseif [string match "-w" $arg] {
+lappend out "-Wall"
+lappend out "-Werror"
+
+} elseif [string match "-wi" $arg] {
+lappend out "-Wall"
+lappend out "-Wno-error"
+
+} else {
+# print "Unhandled Argument: $arg"
+}
+}
+
+return $out
+}
+
+proc gdc-copy-extra { base extra } {
+# Split base, folder/file.
+set type [file dirname $extra]
+
+# print "Filename: $base - $extra"
+
+set fdin [open $base/$extra r]
+fconfigure $fdin