dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PING^3][PATCH 3/3][DejaGNU] target: Wrap linker flags into `-largs'


From: Jacob Bachmeyer
Subject: Re: [PING^3][PATCH 3/3][DejaGNU] target: Wrap linker flags into `-largs'/`-margs' for Ada
Date: Mon, 18 May 2020 16:03:15 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0

Maciej W. Rozycki wrote:
On Fri, 25 Oct 2019, Jacob Bachmeyer wrote:
I have just sent a patch to the list that has been waiting in my local repository since June. It adds unit tests for the default_target_compile procedure, but currently verifies the broken Ada handling. Would you be willing to supply a patch to update those tests to the correct behavior? If so, I will also merge your code on my local branch and we might even avoid the merge conflict down the line.

I might be able to find some time, but please instruct me and also supply with the complete patch set as I note from your submission there are prerequisites.
The patch set is attached. These were generated relative to commit df67223e4be99527fbeab66394f52c420d7f88f1, but are expected to apply cleanly to current master (commit a53deb4787c3229127481445a28a42ee44c8b550 as of this writing).

After applying the patches, search for "TODO FIXME" in testsuite/runtest.libs/target.test (should be at line 616) and examine the following test descriptions. The overall layout should be obvious (I hope) and the "check_calls" patterns are matched in testsuite/runtest.libs/mockutil.tcl:test_proc_with_mocks (lines 179~243). The eval_tests procedure is in target.test (lines 115~125) and is a thin wrapper around test_proc_with_mocks in a slave interpreter.

You are looking for the calls matching attempts to invoke gnatmake using "remote_exec host" and you may consider the braced strings containing gnatmake commands to be the output of the test as that is what your patches will change. (The first of these is: {m68k-unknown-aout-gnatmake foo.adb -midp -fada -E -I/usr/gnemul/idp/include} as far as the matching rules are concerned; whitespace (including newlines) is not significant except as token delimiters. Line wrap and indentation is freely used here.) Note that the arguments given in those commands are not related to what the GNU Ada tools actually expect or accept; they are dummy parameters to ensure that the various configuration values are used, and that the usage of those does not unintentionally change when default_target_compile is rewritten.

Which brings me to another question: do some of those tests even make sense for Ada? Will the rewritten procedure need to accept different sets of "type" values for different languages?

While you are doing that, could you also explain what the various -?args GNU Ada driver options do and if any others are needed or could be needed? I will ensure that the rewrite handles all cases if I can get a solid description of what those cases actually are. The rewrite will group complier/linker/etc. options in separate lists internally, so using those options will be easy without adding more hacks to a procedure that has already become a tissue of hacks.

 Here it goes:
[...]
I was unclear. My concern was ensuring that the various options passed in to default_target_compile (both as options and as configuration) are correctly sorted into compiler/linker/etc. bins and passed with proper mode switches to the Ada frontend. For example, the "optimize=" option is specifically for the compiler, while the "ldflags=" option is specifically for the linker.

I have some documentation written for this, but it documents the correct behavior and includes caveats about two bugs "in DejaGnu 1.6.2 and older" so I am holding the documentation patch until I know what release will have the bugfix patches merged so it will not have to be updated again. (If the bugfix patches (3 and 8 in the attached set) are not merged, the documentation I am holding is wrong. If they are merged, the documentation needs to indicate the last release that had the buggy behavior.)

-- Jacob
>From e52d38235d0897924fde10cf5d7f9711a783686b Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <address@hidden>
Date: Thu, 16 May 2019 20:55:20 -0500
Subject: [PATCH 1/9] Use runtest_file_p in internal unit test driver

*ChangeLog entry:
        * testsuite/runtest.libs/libs.exp: Use runtest_file_p to honor
        requests to run only some library tests.
---
 testsuite/runtest.libs/libs.exp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/testsuite/runtest.libs/libs.exp b/testsuite/runtest.libs/libs.exp
index 8521ead..f42d3db 100644
--- a/testsuite/runtest.libs/libs.exp
+++ b/testsuite/runtest.libs/libs.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016, 2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2018, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -98,7 +98,7 @@ proc process_test { test } {
 
 start_expect
 foreach i [glob [testsuite file -source -test *.test]] {
-    process_test $i
+    if { [runtest_file_p $runtests $i] } { process_test $i }
 }
 stop_expect
 
-- 
1.7.4.1

>From 0094607260e0277aa963db7d59c7c4ac3529e384 Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <address@hidden>
Date: Thu, 16 May 2019 22:03:14 -0500
Subject: [PATCH 2/9] Eliminate unused temporary file in DejaGnu library tests

*ChangeLog entry:
        * testsuite/runtest.libs/default_procs.tcl: Set sum_file to empty
        string instead of opening a temporary file named .tmp.
        * testsuite/runtest.libs/libs.exp: No longer need to remove .tmp.
---
 testsuite/runtest.libs/default_procs.tcl |    2 +-
 testsuite/runtest.libs/libs.exp          |    3 ---
 2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/testsuite/runtest.libs/default_procs.tcl 
b/testsuite/runtest.libs/default_procs.tcl
index 1305672..e2e0c6b 100644
--- a/testsuite/runtest.libs/default_procs.tcl
+++ b/testsuite/runtest.libs/default_procs.tcl
@@ -1,4 +1,4 @@
-set sum_file [open .tmp w]
+set sum_file ""
 set reboot 0
 set errno ""
 
diff --git a/testsuite/runtest.libs/libs.exp b/testsuite/runtest.libs/libs.exp
index f42d3db..e688ab3 100644
--- a/testsuite/runtest.libs/libs.exp
+++ b/testsuite/runtest.libs/libs.exp
@@ -101,6 +101,3 @@ foreach i [glob [testsuite file -source -test *.test]] {
     if { [runtest_file_p $runtests $i] } { process_test $i }
 }
 stop_expect
-
-# Clean up behind ourselves.
-file delete .tmp
-- 
1.7.4.1

>From 7cb6a9fcd198d11c5f969d867d24a17b47d3cdf4 Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <address@hidden>
Date: Fri, 17 May 2019 17:53:54 -0500
Subject: [PATCH 3/9] Fix access to target_info global in default_target_compile

*ChangeLog entry:
        * lib/target.exp (default_target_compile): Use "host_info"
        procedure to probe for a host configuration, instead of checking a
        local empty target_info array due to lacking "global target_info".
---
 lib/target.exp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/target.exp b/lib/target.exp
index 2620e30..9cc262d 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -326,7 +326,7 @@ proc default_target_compile {source destfile type options} {
        append ldflags " $LDFLAGS_FOR_TARGET"
     }
 
-    if {[info exists target_info(host,name)]} {
+    if {[host_info exists]} {
        set host [host_info name]
     } else {
        set host "unix"
-- 
1.7.4.1

>From 1dabf2093f5c25eaa5315caaf62ac3b68ed78e0f Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <address@hidden>
Date: Tue, 21 May 2019 21:31:00 -0500
Subject: [PATCH 4/9] Update internal unit tests for changes from 22 years ago

*ChangeLog entry:
        Fix internal testsuite stubs to reflect previous changes.

        * testsuite/runtest.libs/target.test: Rename fake "target_info"
        array to a fake "board_info" array, to align with changes made to
        the DejaGnu core on 29 January 1997 that moved the target
        configuration data into the global board_info array.

        * testsuite/runtest.libs/remote.test: Likewise.
---
 testsuite/runtest.libs/remote.test |   38 ++++++++++++++++++------------------
 testsuite/runtest.libs/target.test |   38 ++++++++++++++++++------------------
 2 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/testsuite/runtest.libs/remote.test 
b/testsuite/runtest.libs/remote.test
index 5450f95..8152cad 100644
--- a/testsuite/runtest.libs/remote.test
+++ b/testsuite/runtest.libs/remote.test
@@ -21,27 +21,27 @@ if [ file exists $file] {
 global errno ""
 
 #
-# Create a false target config array
+# Create a false board config array
 #
-set target_info(idp,name)       "idp"
-set target_info(idp,ldflags)    "-Tidp.ld"
-set target_info(idp,config)     m68k-unknown-aout
-set target_info(idp,cflags)     ""
-set target_info(idp,connect)    telnet
-set target_info(idp,target)     "s12"
-set target_info(idp,serial)     "tstty12"
-set target_info(idp,netport)    "localhost:23"
-set target_info(idp,baud)       "9600"
+set board_info(idp,name)       "idp"
+set board_info(idp,ldflags)    "-Tidp.ld"
+set board_info(idp,config)     m68k-unknown-aout
+set board_info(idp,cflags)     ""
+set board_info(idp,connect)    telnet
+set board_info(idp,target)     "s12"
+set board_info(idp,serial)     "tstty12"
+set board_info(idp,netport)    "localhost:23"
+set board_info(idp,baud)       "9600"
 # MVME target
-set target_info(mvme,name)      "mvme"
-set target_info(mvme,ldflags)   "-Tmvme.ld"
-set target_info(mvme,config)    m68k-unknown-aout
-set target_info(mvme,cflags)    ""
-set target_info(mvme,connect)   telnet
-set target_info(mvme,target)    "s12"
-set target_info(mvme,serial)    "tstty8"
-set target_info(mvme,netport)   "localhost:23"
-set target_info(mvme,baud)      "9600"
+set board_info(mvme,name)      "mvme"
+set board_info(mvme,ldflags)   "-Tmvme.ld"
+set board_info(mvme,config)    m68k-unknown-aout
+set board_info(mvme,cflags)    ""
+set board_info(mvme,connect)   telnet
+set board_info(mvme,target)    "s12"
+set board_info(mvme,serial)    "tstty8"
+set board_info(mvme,netport)   "localhost:23"
+set board_info(mvme,baud)      "9600"
 
 # Test remote open. We try not to use any of the support procs in
 # target.exp to for isolation testing. "target" is the name of the
diff --git a/testsuite/runtest.libs/target.test 
b/testsuite/runtest.libs/target.test
index 470b4d3..dd3a156 100644
--- a/testsuite/runtest.libs/target.test
+++ b/testsuite/runtest.libs/target.test
@@ -33,27 +33,27 @@ if [ file exists $file] {
 }
 
 #
-# Create a false target config array
+# Create a false board config array
 #
-set target_info(idp,name)       "idp"
-set target_info(idp,ldflags)    "-Tidp.ld"
-set target_info(idp,config)     m68k-unknown-aout
-set target_info(idp,cflags)     ""
-set target_info(idp,connect)    "telnet"
-set target_info(idp,target)     "s12"
-set target_info(idp,serial)     "tstty12"
-set target_info(idp,netport)    "localhost:23"
-set target_info(idp,baud)       "9600"
+set board_info(idp,name)       "idp"
+set board_info(idp,ldflags)    "-Tidp.ld"
+set board_info(idp,config)     m68k-unknown-aout
+set board_info(idp,cflags)     ""
+set board_info(idp,connect)    "telnet"
+set board_info(idp,target)     "s12"
+set board_info(idp,serial)     "tstty12"
+set board_info(idp,netport)    "localhost:23"
+set board_info(idp,baud)       "9600"
 # MVME target
-set target_info(mvme,name)      "mvme"
-set target_info(mvme,ldflags)   "-Tmvme.ld"
-set target_info(mvme,config)    m68k-unknown-aout
-set target_info(mvme,cflags)    ""
-set target_info(mvme,connect)   "telnet"
-set target_info(mvme,target)    "s12"
-set target_info(mvme,serial)    "tstty8"
-set target_info(mvme,netport)   "localhost:23"
-set target_info(mvme,baud)      "9600"
+set board_info(mvme,name)      "mvme"
+set board_info(mvme,ldflags)   "-Tmvme.ld"
+set board_info(mvme,config)    m68k-unknown-aout
+set board_info(mvme,cflags)    ""
+set board_info(mvme,connect)   "telnet"
+set board_info(mvme,target)    "s12"
+set board_info(mvme,serial)    "tstty8"
+set board_info(mvme,netport)   "localhost:23"
+set board_info(mvme,baud)      "9600"
 
 # test push_config target
 push_config target idp
-- 
1.7.4.1

>From 305df6c4beb4b470252253248cb7973841e2ce50 Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <address@hidden>
Date: Wed, 22 May 2019 20:27:23 -0500
Subject: [PATCH 5/9] Clean up whitespace in baseboards/*

*ChangeLog entry:
        * baseboards/aarch64-sim.exp: Clean up whitespace.
        * baseboards/arm-ice.exp: Likewise.
        * baseboards/arm-sim.exp: Likewise.
        * baseboards/basic-sid.exp: Likewise.
        * baseboards/iq2000-sim.exp: Likewise.
        * baseboards/mn10300-sim.exp: Likewise.
        * baseboards/moxie-sim.exp: Likewise.
---
 baseboards/aarch64-sim.exp |    6 +++---
 baseboards/arm-ice.exp     |    6 +++---
 baseboards/arm-sim.exp     |    6 +++---
 baseboards/basic-sid.exp   |    4 ++--
 baseboards/iq2000-sim.exp  |    3 +--
 baseboards/mn10300-sim.exp |    2 +-
 baseboards/moxie-sim.exp   |    1 -
 7 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/baseboards/aarch64-sim.exp b/baseboards/aarch64-sim.exp
index 9680075..8af677c 100644
--- a/baseboards/aarch64-sim.exp
+++ b/baseboards/aarch64-sim.exp
@@ -31,12 +31,12 @@ setup_sim aarch64
 
 # The compiler used to build for this board. This has *nothing* to do
 # with what compiler is tested if we're testing gcc.
-set_board_info compiler        "[find_gcc]"
+set_board_info compiler        "[find_gcc]"
 
 # The basic set of flags needed to build "hello world" for this
 # board. This board uses libgloss and newlib.
-set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
-set_board_info ldflags         "[libgloss_link_flags] [newlib_link_flags] 
-specs=rdimon.specs"
+set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
+set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] 
-specs=rdimon.specs"
 
 # This board doesn't use a linker script.
 set_board_info ldscript ""
diff --git a/baseboards/arm-ice.exp b/baseboards/arm-ice.exp
index 6b698b2..dd5f3ea 100644
--- a/baseboards/arm-ice.exp
+++ b/baseboards/arm-ice.exp
@@ -32,11 +32,11 @@ if { [board_info $board obj_format] eq "pe" } {
 # basic-sim.exp is a basic description for the standard Cygnus simulator.
 # The compiler used to build for this board. This has *nothing* to do
 # with what compiler is tested if we're testing gcc.
-set_board_info compiler        "[find_gcc]"
+set_board_info compiler        "[find_gcc]"
 # The basic set of flags needed to build "hello world" for this
 # board. This board uses libgloss and newlib.
-set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
-set_board_info ldflags         "[libgloss_link_flags] [newlib_link_flags] 
$additional_options"
+set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
+set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] 
$additional_options"
 # This board doesn't use a linker script.
 set_board_info ldscript ""
 
diff --git a/baseboards/arm-sim.exp b/baseboards/arm-sim.exp
index ca8f8c2..ca0d759 100644
--- a/baseboards/arm-sim.exp
+++ b/baseboards/arm-sim.exp
@@ -43,12 +43,12 @@ setup_sim arm
 
 # The compiler used to build for this board. This has *nothing* to do
 # with what compiler is tested if we're testing gcc.
-set_board_info compiler        "[find_gcc]"
+set_board_info compiler        "[find_gcc]"
 
 # The basic set of flags needed to build "hello world" for this
 # board. This board uses libgloss and newlib.
-set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
-set_board_info ldflags         "[libgloss_link_flags] [newlib_link_flags] 
$additional_options"
+set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
+set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] 
$additional_options"
 
 # This board doesn't use a linker script.
 set_board_info ldscript ""
diff --git a/baseboards/basic-sid.exp b/baseboards/basic-sid.exp
index a09af6d..a4605f0 100644
--- a/baseboards/basic-sid.exp
+++ b/baseboards/basic-sid.exp
@@ -65,10 +65,10 @@ proc find_rawsid { } {
        set env(SID_LIBRARY_PATH) [join [glob $tool_root_dir/sid/component/* 
$srcdir/sid/component/*] ":"]
        # srcdir=/..../sid/component/testsuite
        set tcl_library $srcdir/tcl/library
-        global host_os
+       global host_os
        switch -glob -- $host_os {
            {cygwin*} { set tcl_library [exec cygpath -w $tcl_library] }
-        }
+       }
        set env(TCL_LIBRARY) $tcl_library
     }
 
diff --git a/baseboards/iq2000-sim.exp b/baseboards/iq2000-sim.exp
index 53ff2c0..7664008 100644
--- a/baseboards/iq2000-sim.exp
+++ b/baseboards/iq2000-sim.exp
@@ -43,11 +43,10 @@ set_board_info ldscript "-Tsim.ld"
 # The simulator doesn't return exit statuses and we need to indicate this
 # the standard GCC wrapper will work with this target.
 set_board_info needs_status_wrapper  1
-# Doesn't pass arguments or handle signals, 
+# Doesn't pass arguments or handle signals,
 # Can return results.
 # Does do inferiorio.
 set_board_info noargs 1
 set_board_info gcc,no_trampolines 1
 set_board_info gcc,no_label_values 1
 set_board_info gdb,nosignals 1
-
diff --git a/baseboards/mn10300-sim.exp b/baseboards/mn10300-sim.exp
index 875a787..c69bcd6 100644
--- a/baseboards/mn10300-sim.exp
+++ b/baseboards/mn10300-sim.exp
@@ -45,7 +45,7 @@ set_board_info ldflags  "[libgloss_link_flags] 
[newlib_link_flags]"
 set_board_info ldscript "-Tsim.ld"
 
 # The simulator doesn't return exit statuses and we need to indicate this.
-set_board_info needs_status_wrapper "" 
+set_board_info needs_status_wrapper ""
 
 # We can't pass args to the simulator or get exit status back from the
 # simulator, nor does the simulator support real signals.
diff --git a/baseboards/moxie-sim.exp b/baseboards/moxie-sim.exp
index 858fb3f..bf1892a 100644
--- a/baseboards/moxie-sim.exp
+++ b/baseboards/moxie-sim.exp
@@ -56,4 +56,3 @@ set_board_info gdb,timeout 60
 # Used by a few gcc.c-torture testcases to delimit how large the stack can
 # be.
 set_board_info gcc,stack_size  5000
-
-- 
1.7.4.1

>From 1d8143c8c01d6db1f2d5093931982033cbf29342 Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <address@hidden>
Date: Wed, 22 May 2019 20:52:25 -0500
Subject: [PATCH 6/9] Use GCC as default compiler

*ChangeLog entry:
        * doc/dejagnu.texi (Adding a new board): Document that the
        "compiler" board_info field is optional and defaults to [find_gcc]
        if not given.
        (Board configuration file): Likewise.

        * lib/target.exp (default_target_compile): Establish a default C
        compiler by evaluating [find_gcc] if no other compiler is given.

        * baseboards/aarch64-sim.exp: Remove no-longer-needed
        "set_board_info compiler [find_gcc]" from this file.
        * baseboards/am33_2.0-libremote.exp: Likewise.
        * baseboards/androideabi.exp: Likewise.
        * baseboards/arm-ice.exp: Likewise.
        * baseboards/arm-sim.exp: Likewise.
        * baseboards/cris-sim.exp: Likewise.
        * baseboards/d30v-sim.exp: Likewise.
        * baseboards/fr30-sim.exp: Likewise.
        * baseboards/frv-sim.exp: Likewise.
        * baseboards/gdbserver-sample.exp: Likewise.
        * baseboards/iq2000-sim.exp: Likewise.
        * baseboards/linux-gdbserver.exp: Likewise.
        * baseboards/linux-libremote.exp: Likewise.
        * baseboards/mcore-moto-sim.exp: Likewise.
        * baseboards/mcore-sim.exp: Likewise.
        * baseboards/mips-sim-idt32.exp: Likewise.
        * baseboards/mips-sim-idt64.exp: Likewise.
        * baseboards/mips-sim-mti32.exp: Likewise.
        * baseboards/mips-sim-mti64.exp: Likewise.
        * baseboards/mips-sim-mti64_64.exp: Likewise.
        * baseboards/mips-sim-mti64_n32.exp: Likewise.
        * baseboards/mips-sim-sde32.exp: Likewise.
        * baseboards/mips-sim-sde64.exp: Likewise.
        * baseboards/mips-sim.exp: Likewise.
        * baseboards/mmixware-sim.exp: Likewise.
        * baseboards/mn10200-sim.exp: Likewise.
        * baseboards/mn10300-sim.exp: Likewise.
        * baseboards/moxie-sim.exp: Likewise.
        * baseboards/msp430-sim.exp: Likewise.
        * baseboards/powerpc-sim.exp: Likewise.
        * baseboards/powerpcle-sim.exp: Likewise.
        * baseboards/rx-sim.exp: Likewise.
        * baseboards/sh-sim.exp: Likewise.
        * baseboards/sparc-sim.exp: Likewise.
        * baseboards/sparc64-sim.exp: Likewise.
        * baseboards/sparclite-sim-le.exp: Likewise.
        * baseboards/sparclite-sim.exp: Likewise.
        * baseboards/unix.exp: Likewise.
        * baseboards/v850-sim.exp: Likewise.
        * baseboards/visium-sim.exp: Likewise.
        * baseboards/xtensa-sim.exp: Likewise.
---
 baseboards/aarch64-sim.exp        |    6 +-----
 baseboards/am33_2.0-libremote.exp |    3 +--
 baseboards/androideabi.exp        |    4 +---
 baseboards/arm-ice.exp            |    6 ++----
 baseboards/arm-sim.exp            |    6 +-----
 baseboards/cris-sim.exp           |    3 +--
 baseboards/d30v-sim.exp           |    6 +-----
 baseboards/fr30-sim.exp           |    3 +--
 baseboards/frv-sim.exp            |    3 +--
 baseboards/gdbserver-sample.exp   |    4 +---
 baseboards/iq2000-sim.exp         |    3 +--
 baseboards/linux-gdbserver.exp    |    5 +----
 baseboards/linux-libremote.exp    |    5 +----
 baseboards/mcore-moto-sim.exp     |    3 +--
 baseboards/mcore-sim.exp          |    3 +--
 baseboards/mips-sim-idt32.exp     |    5 +----
 baseboards/mips-sim-idt64.exp     |    5 +----
 baseboards/mips-sim-mti32.exp     |    5 +----
 baseboards/mips-sim-mti64.exp     |    5 +----
 baseboards/mips-sim-mti64_64.exp  |    5 +----
 baseboards/mips-sim-mti64_n32.exp |    5 +----
 baseboards/mips-sim-sde32.exp     |    5 +----
 baseboards/mips-sim-sde64.exp     |    5 +----
 baseboards/mips-sim.exp           |    6 +-----
 baseboards/mmixware-sim.exp       |    6 +-----
 baseboards/mn10200-sim.exp        |    6 +-----
 baseboards/mn10300-sim.exp        |    6 +-----
 baseboards/moxie-sim.exp          |    3 +--
 baseboards/msp430-sim.exp         |    1 -
 baseboards/powerpc-sim.exp        |    6 +-----
 baseboards/powerpcle-sim.exp      |    6 +-----
 baseboards/rx-sim.exp             |    3 +--
 baseboards/sh-sim.exp             |    3 +--
 baseboards/sparc-sim.exp          |    3 +--
 baseboards/sparc64-sim.exp        |    3 +--
 baseboards/sparclite-sim-le.exp   |    3 +--
 baseboards/sparclite-sim.exp      |    3 +--
 baseboards/unix.exp               |    4 +---
 baseboards/v850-sim.exp           |    3 +--
 baseboards/visium-sim.exp         |    3 +--
 baseboards/xtensa-sim.exp         |    3 +--
 doc/dejagnu.texi                  |    6 ++++--
 lib/target.exp                    |    8 ++++++--
 43 files changed, 51 insertions(+), 137 deletions(-)

diff --git a/baseboards/aarch64-sim.exp b/baseboards/aarch64-sim.exp
index 8af677c..28258b0 100644
--- a/baseboards/aarch64-sim.exp
+++ b/baseboards/aarch64-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,10 +29,6 @@ load_base_board_description "basic-sim"
 # The name of the directory in the build tree where the simulator lives.
 setup_sim aarch64
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler        "[find_gcc]"
-
 # The basic set of flags needed to build "hello world" for this
 # board. This board uses libgloss and newlib.
 set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/am33_2.0-libremote.exp 
b/baseboards/am33_2.0-libremote.exp
index 442efa4..5df36d4 100644
--- a/baseboards/am33_2.0-libremote.exp
+++ b/baseboards/am33_2.0-libremote.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -24,7 +24,6 @@ load_generic_config "libremote_server"
 process_multilib_options ""
 
 # The default compiler for this target.
-#set_board_info compiler     "[find_gcc]"
 set_board_info compiler     "am33_2.0-linux-gnu-gcc"
 
 # We will be using the standard GDB remote protocol
diff --git a/baseboards/androideabi.exp b/baseboards/androideabi.exp
index 2a08bb8..fe610a5 100644
--- a/baseboards/androideabi.exp
+++ b/baseboards/androideabi.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2016 Free Software Foundation, Inc.
+# Copyright (C) 2013-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -23,8 +23,6 @@ load_generic_config "adb"
 # We need this for find_gcc and *_include_flags/*_link_flags.
 load_base_board_description "adb"
 
-set_board_info compiler  "[find_gcc]"
-
 # We may need -mandroid.
 set_board_info cflags  "-mandroid"
 set_board_info ldflags  "-mandroid"
diff --git a/baseboards/arm-ice.exp b/baseboards/arm-ice.exp
index dd5f3ea..c9c37ca 100644
--- a/baseboards/arm-ice.exp
+++ b/baseboards/arm-ice.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -30,9 +30,7 @@ if { [board_info $board obj_format] eq "pe" } {
 }
 
 # basic-sim.exp is a basic description for the standard Cygnus simulator.
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler        "[find_gcc]"
+
 # The basic set of flags needed to build "hello world" for this
 # board. This board uses libgloss and newlib.
 set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/arm-sim.exp b/baseboards/arm-sim.exp
index ca0d759..bab1709 100644
--- a/baseboards/arm-sim.exp
+++ b/baseboards/arm-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -41,10 +41,6 @@ load_base_board_description "basic-sim"
 # The name of the directory in the build tree where the simulator lives.
 setup_sim arm
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler        "[find_gcc]"
-
 # The basic set of flags needed to build "hello world" for this
 # board. This board uses libgloss and newlib.
 set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/cris-sim.exp b/baseboards/cris-sim.exp
index 713b5cc..f3211c2 100644
--- a/baseboards/cris-sim.exp
+++ b/baseboards/cris-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -77,7 +77,6 @@ if { ![board_info $board exists sim,options] && $cris_simopt 
ne "" } {
 # target.  We assume that all multilib options have been specified
 # before we get here.
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags] 
$cris_ldopt"
 # No linker script needed.
diff --git a/baseboards/d30v-sim.exp b/baseboards/d30v-sim.exp
index 374679b..87c136f 100644
--- a/baseboards/d30v-sim.exp
+++ b/baseboards/d30v-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,10 +29,6 @@ load_base_board_description "basic-sim"
 # The name of the simulator directory is "d30v".
 setup_sim d30v
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler  "[find_gcc]"
-
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
 # Pass -C to the assembler to suppress the warning about symbols being the 
same name as registers
diff --git a/baseboards/fr30-sim.exp b/baseboards/fr30-sim.exp
index 1cc379f..64e1f23 100644
--- a/baseboards/fr30-sim.exp
+++ b/baseboards/fr30-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -35,7 +35,6 @@ process_multilib_options ""
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags]"
 # No linker script needed.
diff --git a/baseboards/frv-sim.exp b/baseboards/frv-sim.exp
index cf0797f..f0cab80 100644
--- a/baseboards/frv-sim.exp
+++ b/baseboards/frv-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -35,7 +35,6 @@ process_multilib_options ""
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags]"
 # No linker script needed.
diff --git a/baseboards/gdbserver-sample.exp b/baseboards/gdbserver-sample.exp
index 21f59fc..f5740a8 100644
--- a/baseboards/gdbserver-sample.exp
+++ b/baseboards/gdbserver-sample.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -23,8 +23,6 @@ load_generic_config "gdbserver"
 process_multilib_options ""
 
 # The default compiler for this target.
-set_board_info compiler  "[find_gcc]"
-
 #set_board_info compiler  "/opt/src/gcc/install-30/bin/gcc"
 #set_board_info c++compiler  "/opt/src/gcc/install-30/bin/g++"
 
diff --git a/baseboards/iq2000-sim.exp b/baseboards/iq2000-sim.exp
index 7664008..68fcfb7 100644
--- a/baseboards/iq2000-sim.exp
+++ b/baseboards/iq2000-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -34,7 +34,6 @@ process_multilib_options ""
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags]"
 # Special linker script needed to run C programs.
diff --git a/baseboards/linux-gdbserver.exp b/baseboards/linux-gdbserver.exp
index ef51555..455dc23 100644
--- a/baseboards/linux-gdbserver.exp
+++ b/baseboards/linux-gdbserver.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -22,9 +22,6 @@ load_generic_config "gdbserver"
 
 process_multilib_options ""
 
-# The default compiler for this target.
-set_board_info compiler  "[find_gcc]"
-
 # We will be using the standard GDB remote protocol
 set_board_info gdb_protocol "remote"
 
diff --git a/baseboards/linux-libremote.exp b/baseboards/linux-libremote.exp
index 3936c37..6e351e5 100644
--- a/baseboards/linux-libremote.exp
+++ b/baseboards/linux-libremote.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -22,9 +22,6 @@ load_generic_config "gdbserver"
 
 process_multilib_options ""
 
-# The default compiler for this target.
-set_board_info compiler  "[find_gcc]"
-
 # We will be using the standard GDB remote protocol
 set_board_info gdb_protocol "remote"
 
diff --git a/baseboards/mcore-moto-sim.exp b/baseboards/mcore-moto-sim.exp
index d9db95a..3405b74 100644
--- a/baseboards/mcore-moto-sim.exp
+++ b/baseboards/mcore-moto-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -33,7 +33,6 @@ process_multilib_options ""
 
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags]"
 
diff --git a/baseboards/mcore-sim.exp b/baseboards/mcore-sim.exp
index e2fbad8..98839ad 100644
--- a/baseboards/mcore-sim.exp
+++ b/baseboards/mcore-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -35,7 +35,6 @@ process_multilib_options ""
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags]"
 # No linker script needed.
diff --git a/baseboards/mips-sim-idt32.exp b/baseboards/mips-sim-idt32.exp
index a16529a..ccd6997 100644
--- a/baseboards/mips-sim-idt32.exp
+++ b/baseboards/mips-sim-idt32.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,9 +29,6 @@ setup_sim mips
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler "[find_gcc]"
 #set_board_info needs_status_wrapper 1
 
 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/mips-sim-idt64.exp b/baseboards/mips-sim-idt64.exp
index d85acd1..249bbf1 100644
--- a/baseboards/mips-sim-idt64.exp
+++ b/baseboards/mips-sim-idt64.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,9 +29,6 @@ setup_sim mips
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler "[find_gcc]"
 #set_board_info needs_status_wrapper 1
 
 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/mips-sim-mti32.exp b/baseboards/mips-sim-mti32.exp
index 56f6d2c..e3fa66d 100644
--- a/baseboards/mips-sim-mti32.exp
+++ b/baseboards/mips-sim-mti32.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2016 Free Software Foundation, Inc.
+# Copyright (C) 2012-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,9 +29,6 @@ setup_sim mips
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler "[find_gcc]"
 #set_board_info needs_status_wrapper 1
 
 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/mips-sim-mti64.exp b/baseboards/mips-sim-mti64.exp
index 6d2bfdc..cd4b4d2 100644
--- a/baseboards/mips-sim-mti64.exp
+++ b/baseboards/mips-sim-mti64.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2016 Free Software Foundation, Inc.
+# Copyright (C) 2012-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,9 +29,6 @@ setup_sim mips
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler "[find_gcc]"
 #set_board_info needs_status_wrapper 1
 
 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/mips-sim-mti64_64.exp b/baseboards/mips-sim-mti64_64.exp
index 841aabd..f589b2a 100644
--- a/baseboards/mips-sim-mti64_64.exp
+++ b/baseboards/mips-sim-mti64_64.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2016 Free Software Foundation, Inc.
+# Copyright (C) 2012-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,9 +29,6 @@ setup_sim mips
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler "[find_gcc]"
 #set_board_info needs_status_wrapper 1
 
 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/mips-sim-mti64_n32.exp 
b/baseboards/mips-sim-mti64_n32.exp
index e622d4b..13bf01f 100644
--- a/baseboards/mips-sim-mti64_n32.exp
+++ b/baseboards/mips-sim-mti64_n32.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2016 Free Software Foundation, Inc.
+# Copyright (C) 2012-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,9 +29,6 @@ setup_sim mips
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler "[find_gcc]"
 #set_board_info needs_status_wrapper 1
 
 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/mips-sim-sde32.exp b/baseboards/mips-sim-sde32.exp
index a25fbd7..e5a9265 100644
--- a/baseboards/mips-sim-sde32.exp
+++ b/baseboards/mips-sim-sde32.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2016 Free Software Foundation, Inc.
+# Copyright (C) 2012-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,9 +29,6 @@ setup_sim mips
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler "[find_gcc]"
 #set_board_info needs_status_wrapper 1
 
 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/mips-sim-sde64.exp b/baseboards/mips-sim-sde64.exp
index 5e17660..0cb7efb 100644
--- a/baseboards/mips-sim-sde64.exp
+++ b/baseboards/mips-sim-sde64.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2016 Free Software Foundation, Inc.
+# Copyright (C) 2012-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,9 +29,6 @@ setup_sim mips
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler "[find_gcc]"
 #set_board_info needs_status_wrapper 1
 
 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
diff --git a/baseboards/mips-sim.exp b/baseboards/mips-sim.exp
index aea34ce..cf6c93b 100644
--- a/baseboards/mips-sim.exp
+++ b/baseboards/mips-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -29,10 +29,6 @@ setup_sim mips
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler "[find_gcc]"
-
 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"
 
diff --git a/baseboards/mmixware-sim.exp b/baseboards/mmixware-sim.exp
index cab363a..e5951fa 100644
--- a/baseboards/mmixware-sim.exp
+++ b/baseboards/mmixware-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -52,10 +52,6 @@ set_board_info is_simulator 1
 # can deal with separately.
 set_board_info obj_format "elf"
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler  "[find_gcc]"
-
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
 set_board_info cflags  "[newlib_include_flags]"
diff --git a/baseboards/mn10200-sim.exp b/baseboards/mn10200-sim.exp
index 773ea1a..77c9d52 100644
--- a/baseboards/mn10200-sim.exp
+++ b/baseboards/mn10200-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -33,10 +33,6 @@ setup_sim mn10200
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler  "[find_gcc]"
-
 # We only support newlib on this target.
 set_board_info cflags  "[newlib_include_flags] [libgloss_include_flags]"
 set_board_info ldflags  "[libgloss_link_flags] [newlib_link_flags]"
diff --git a/baseboards/mn10300-sim.exp b/baseboards/mn10300-sim.exp
index c69bcd6..c8aa0cd 100644
--- a/baseboards/mn10300-sim.exp
+++ b/baseboards/mn10300-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -33,10 +33,6 @@ setup_sim mn10300
 # No multilib flags are set by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler  "[find_gcc]"
-
 # We only support newlib on this target.
 set_board_info cflags  "[newlib_include_flags] [libgloss_include_flags]"
 set_board_info ldflags  "[libgloss_link_flags] [newlib_link_flags]"
diff --git a/baseboards/moxie-sim.exp b/baseboards/moxie-sim.exp
index bf1892a..2b80afe 100644
--- a/baseboards/moxie-sim.exp
+++ b/baseboards/moxie-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2010-2016 Free Software Foundation, Inc.
+# Copyright (C) 2010-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -34,7 +34,6 @@ process_multilib_options ""
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags]"
 # No linker script needed.
diff --git a/baseboards/msp430-sim.exp b/baseboards/msp430-sim.exp
index f43bdff..32be556 100644
--- a/baseboards/msp430-sim.exp
+++ b/baseboards/msp430-sim.exp
@@ -17,7 +17,6 @@ process_multilib_options ""
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[libgloss_include_flags] [newlib_include_flags] 
-msim"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags]"
 
diff --git a/baseboards/powerpc-sim.exp b/baseboards/powerpc-sim.exp
index 5d40a67..19b7b93 100644
--- a/baseboards/powerpc-sim.exp
+++ b/baseboards/powerpc-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -32,10 +32,6 @@ setup_sim ppc
 # No multilib flags needed by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler  "[find_gcc]"
-
 set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags  "-msim [libgloss_link_flags] [newlib_link_flags]"
 
diff --git a/baseboards/powerpcle-sim.exp b/baseboards/powerpcle-sim.exp
index bf3cf65..9b9ba32 100644
--- a/baseboards/powerpcle-sim.exp
+++ b/baseboards/powerpcle-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -32,10 +32,6 @@ setup_sim ppc
 # No multilib flags needed by default.
 process_multilib_options ""
 
-# The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
-set_board_info compiler  "[find_gcc]"
-
 set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags  "-msim [libgloss_link_flags] [newlib_link_flags]"
 
diff --git a/baseboards/rx-sim.exp b/baseboards/rx-sim.exp
index fbc0560..9ee44ad 100644
--- a/baseboards/rx-sim.exp
+++ b/baseboards/rx-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -38,7 +38,6 @@ setup_sim rx
 
 process_multilib_options ""
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[newlib_include_flags] -msim"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags]"
 
diff --git a/baseboards/sh-sim.exp b/baseboards/sh-sim.exp
index 3a3c959..6e62d1e 100644
--- a/baseboards/sh-sim.exp
+++ b/baseboards/sh-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -35,7 +35,6 @@ process_multilib_options ""
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags]"
 # No linker script needed.
diff --git a/baseboards/sparc-sim.exp b/baseboards/sparc-sim.exp
index 8a2d274..95a4ce9 100644
--- a/baseboards/sparc-sim.exp
+++ b/baseboards/sparc-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -33,7 +33,6 @@ setup_sim erc32
 # It needs no multilib flags by default.
 process_multilib_options ""
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags  "[newlib_include_flags] [libgloss_include_flags]"
 set_board_info ldflags  "-nostdlib -nostartfiles [libgloss_link_flags] 
[newlib_link_flags]"
 
diff --git a/baseboards/sparc64-sim.exp b/baseboards/sparc64-sim.exp
index b36ff89..f019203 100644
--- a/baseboards/sparc64-sim.exp
+++ b/baseboards/sparc64-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -33,7 +33,6 @@ setup_sim sparc64
 
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags  "[libgloss_link_flags] [newlib_link_flags]"
 # No linker script.
diff --git a/baseboards/sparclite-sim-le.exp b/baseboards/sparclite-sim-le.exp
index fee838c..28898e0 100644
--- a/baseboards/sparclite-sim-le.exp
+++ b/baseboards/sparclite-sim-le.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -37,7 +37,6 @@ setup_sim erc32
 # It needs no multilib flags by default.
 process_multilib_options ""
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags  "[newlib_include_flags] [libgloss_include_flags]"
 set_board_info ldflags  "-nostdlib -nostartfiles [libgloss_link_flags] 
[newlib_link_flags]"
 
diff --git a/baseboards/sparclite-sim.exp b/baseboards/sparclite-sim.exp
index 81a3253..ffb5ddd 100644
--- a/baseboards/sparclite-sim.exp
+++ b/baseboards/sparclite-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -33,7 +33,6 @@ setup_sim erc32
 # It needs no multilib flags by default.
 process_multilib_options ""
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags  "[newlib_include_flags] [libgloss_include_flags]"
 set_board_info ldflags  "-nostdlib -nostartfiles [libgloss_link_flags] 
[newlib_link_flags]"
 
diff --git a/baseboards/unix.exp b/baseboards/unix.exp
index d6adbe1..4ffb4b6 100644
--- a/baseboards/unix.exp
+++ b/baseboards/unix.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -21,8 +21,6 @@ load_generic_config "unix"
 
 process_multilib_options ""
 
-set_board_info compiler  "[find_gcc]"
-
 set_board_info bmk,use_alarm 1
 
 # Do not use -lm on Cygwin
diff --git a/baseboards/v850-sim.exp b/baseboards/v850-sim.exp
index 4365fa0..db62606 100644
--- a/baseboards/v850-sim.exp
+++ b/baseboards/v850-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -33,7 +33,6 @@ setup_sim v850
 
 # We only support newlib on this target. We assume that all multilib
 # options have been specified before we get here.
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags  "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags  "[libgloss_link_flags] [newlib_link_flags]"
 # DDB linker script.
diff --git a/baseboards/visium-sim.exp b/baseboards/visium-sim.exp
index b4e1ed3..de0861c 100644
--- a/baseboards/visium-sim.exp
+++ b/baseboards/visium-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2016 Free Software Foundation, Inc.
+# Copyright (C) 2013-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -32,7 +32,6 @@ setup_sim visium
 # No multilib flags needed by default.
 process_multilib_options ""
 
-set_board_info compiler "[find_gcc]"
 set_board_info cflags   "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags  "-msim [libgloss_link_flags] [newlib_link_flags]"
 
diff --git a/baseboards/xtensa-sim.exp b/baseboards/xtensa-sim.exp
index 5b8e0d0..210c3be 100644
--- a/baseboards/xtensa-sim.exp
+++ b/baseboards/xtensa-sim.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -32,7 +32,6 @@ set_board_info is_simulator 1
 # No default multilib options are needed for this board.
 process_multilib_options ""
 
-set_board_info compiler  "[find_gcc]"
 set_board_info cflags    "[libgloss_include_flags] [newlib_include_flags]"
 set_board_info ldflags   "[libgloss_link_flags] [newlib_link_flags]"
 
diff --git a/doc/dejagnu.texi b/doc/dejagnu.texi
index 92383b2..ccccb91 100644
--- a/doc/dejagnu.texi
+++ b/doc/dejagnu.texi
@@ -1424,7 +1424,8 @@ There are five helper procedures used in this example:
 @code{find_gcc} looks for a copy of the GNU compiler in your build
 tree, or it uses the one in your path.  This will also return the
 proper transformed name for a cross compiler if you whole build tree
-is configured for one.
+is configured for one.  DejaGnu will use this procedure to locate a
+compiler if the @code{compiler} field is not set.
 
 @item
 @code{libgloss_include_flags} returns the flags to compile using
@@ -1965,7 +1966,8 @@ load_generic_config "sim"
 load_base_board_description "basic-sim"
 
 # The compiler used to build for this board. This has *nothing* to do
-# with what compiler is tested if we're testing gcc.
+# with what compiler is tested if we're testing gcc. Further, this is
+# the default, so this line is optional for most boards.
 set_board_info compiler "[find_gcc]"
 
 # We only support newlib on this target.
diff --git a/lib/target.exp b/lib/target.exp
index 9cc262d..a9ac83e 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-2016 Free Software Foundation, Inc.
+# Copyright (C) 1992-2016, 2019 Free Software Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -489,7 +489,11 @@ proc default_target_compile {source destfile type options} 
{
     }
 
     if { $compiler eq "" } {
-       set compiler [board_info $dest compiler]
+       if { [board_info $dest exists compiler] } {
+           set compiler [board_info $dest compiler]
+       } elseif { $compiler_type eq "c" } {
+           set compiler [find_gcc]
+       }
        if { $compiler eq "" } {
            return "default_target_compile: No compiler to compile with"
        }
-- 
1.7.4.1

>From a3301737c90466b39b8cc7ea3ff5b85cf74eccbe Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <address@hidden>
Date: Fri, 31 May 2019 17:42:05 -0500
Subject: [PATCH 7/9] Improve remote_exec procedure documentation

*ChangeLog entry:
        * doc/dejagnu.texi (remote_exec procedure): Explicitly list
        optional arguments instead of simply copying the Tcl argument list
        for the remote_exec procedure.
---
 doc/dejagnu.texi |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/doc/dejagnu.texi b/doc/dejagnu.texi
index ccccb91..34b11a1 100644
--- a/doc/dejagnu.texi
+++ b/doc/dejagnu.texi
@@ -3462,7 +3462,8 @@ program.  This may be an empty string if output from the 
program was
 redirected.
 
 @quotation
-@t{@b{remote_exec} @i{hostname} @i{program} @i{args}}
+@t{  @b{remote_exec} @i{hostname} @i{program}
+?@i{options}? ?@i{input}? ?@i{output}? ?@i{timeout}?}
 @end quotation
 
 @table @asis
@@ -3470,19 +3471,25 @@ redirected.
 Name of the host to execute the command on.
 
 @item @code{program}
-Command
-@item @code{args}
-There are four optional arguments:
+Command to execute.
 
-@enumerate
-@item arguments to pass to the program;
-@item an input filename to feed to stanard input of the command;
-@item an output filename where the output from the command should be written; 
and
-@item timeout value in seconds.
-@end enumerate
+@item @code{options}
+Arguments to pass to the program.
+
+@item @code{input}
+Input filename to feed to standard input of the command.
+
+@item @code{output}
+Output filename where the output from the command should be written.
+
+@item @code{timeout}
+Timeout value in seconds.
 
 @end table
 
+All of the optional positional arguments accept an empty string as a
+neutral value.
+
 @node remote_expect procedure, remote_file procedure, remote_exec procedure, 
Procedures For Remote Communication
 @subsubheading remote_expect Procedure
 @findex remote_expect
@@ -5668,4 +5675,4 @@ This makes @code{runtest} exit.  Abbreviation: @kbd{q}.
 
 @c  LocalWords:  subdirectory prepend prepended testsuite filename Expect's svn
 @c  LocalWords:  DejaGnu CVS RCS SCCS prepending subcommands Tcl Awk Readline
-@c  LocalWords:  POSIX KFAIL KPASS XFAIL XPASS
+@c  LocalWords:  POSIX KFAIL KPASS XFAIL XPASS hostname
-- 
1.7.4.1

>From 9e163d9a322a4e5e452d4c610665ea3330de868b Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <address@hidden>
Date: Fri, 31 May 2019 18:16:08 -0500
Subject: [PATCH 8/9] Fix misuse of "target_info" in default_target_compile

*ChangeLog entry:
        * lib/target.exp (default_target_compile): Use the "board_info"
        procedure correctly when loading language defaults, instead of
        checking for each option under the $dest board, but reading the
        value using "target_info", which uses the current target instead
        of the target specified using the "dest=" option.
---
 lib/target.exp |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/target.exp b/lib/target.exp
index a9ac83e..6a940af 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -337,10 +337,10 @@ proc default_target_compile {source destfile type 
options} {
        if { $i eq "ada" } {
            set compiler_type "ada"
            if {[board_info $dest exists adaflags]} {
-               append add_flags " [target_info adaflags]"
+               append add_flags " [board_info $dest adaflags]"
            }
            if {[board_info $dest exists gnatmake]} {
-               set compiler [target_info gnatmake]
+               set compiler [board_info $dest gnatmake]
            } else {
                set compiler [find_gnatmake]
            }
@@ -349,11 +349,11 @@ proc default_target_compile {source destfile type 
options} {
        if { $i eq "c++" } {
            set compiler_type "c++"
            if {[board_info $dest exists cxxflags]} {
-               append add_flags " [target_info cxxflags]"
+               append add_flags " [board_info $dest cxxflags]"
            }
            append add_flags " [g++_include_flags]"
            if {[board_info $dest exists c++compiler]} {
-               set compiler [target_info c++compiler]
+               set compiler [board_info $dest c++compiler]
            } else {
                set compiler [find_g++]
            }
@@ -362,10 +362,10 @@ proc default_target_compile {source destfile type 
options} {
        if { $i eq "d" } {
            set compiler_type "d"
            if {[board_info $dest exists dflags]} {
-               append add_flags " [target_info dflags]"
+               append add_flags " [board_info $dest dflags]"
            }
            if {[board_info $dest exists dcompiler]} {
-               set compiler [target_info dcompiler]
+               set compiler [board_info $dest dcompiler]
            } else {
                set compiler [find_gdc]
            }
@@ -374,10 +374,10 @@ proc default_target_compile {source destfile type 
options} {
        if { $i eq "f77" } {
            set compiler_type "f77"
            if {[board_info $dest exists f77flags]} {
-               append add_flags " [target_info f77flags]"
+               append add_flags " [board_info $dest f77flags]"
            }
            if {[board_info $dest exists f77compiler]} {
-               set compiler [target_info f77compiler]
+               set compiler [board_info $dest f77compiler]
            } else {
                set compiler [find_g77]
            }
@@ -386,10 +386,10 @@ proc default_target_compile {source destfile type 
options} {
        if { $i eq "f90" } {
            set compiler_type "f90"
            if {[board_info $dest exists f90flags]} {
-               append add_flags " [target_info f90flags]"
+               append add_flags " [board_info $dest f90flags]"
            }
            if {[board_info $dest exists f90compiler]} {
-               set compiler [target_info f90compiler]
+               set compiler [board_info $dest f90compiler]
            } else {
                set compiler [find_gfortran]
            }
-- 
1.7.4.1

>From 06533260481ac28613f0eb3d49a942d8df923cf4 Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <address@hidden>
Date: Thu, 6 Jun 2019 18:18:12 -0500
Subject: [PATCH 9/9] Add tests for target.exp:default_target_compile

*ChangeLog entry:
        * testsuite/runtest.libs/target.test: Use mockutil.tcl.
        Collect loading DejaGnu libraries into a single loop.
        Revise the mock board_info array.
        Add section headings for different test groups in this file.
        Add tests for default_target_compile in lib/target.exp.
        * testsuite/runtest.libs/mockutil.tcl: New file.
---
 testsuite/runtest.libs/mockutil.tcl |  246 +++++++
 testsuite/runtest.libs/target.test  | 1312 ++++++++++++++++++++++++++++++++++-
 2 files changed, 1525 insertions(+), 33 deletions(-)
 create mode 100644 testsuite/runtest.libs/mockutil.tcl

diff --git a/testsuite/runtest.libs/mockutil.tcl 
b/testsuite/runtest.libs/mockutil.tcl
new file mode 100644
index 0000000..a8fa2fd
--- /dev/null
+++ b/testsuite/runtest.libs/mockutil.tcl
@@ -0,0 +1,246 @@
+# Copyright (C) 2019 Free Software Foundation, Inc.
+#
+# This file is part of DejaGnu.
+#
+# DejaGnu 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.
+#
+# DejaGnu 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 DejaGnu; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+
+# This file was written by Jacob Bachmeyer.
+
+# This library provides convenience procedures for running isolated tests
+# of DejaGnu procedures in a slave interpreter.  These are designed to be
+# run in the child process used by the DejaGnu library tests.
+
+proc strip_comment_lines { text } {
+    regsub -all -- {\n[[:space:]]*#[^\r\n]*[\r\n]+} $text "\n"
+}
+
+proc create_test_interpreter { name opts } {
+    array set opt {
+       copy_arrays {} copy_procs {} copy_vars {}
+       link_channels {} link_procs {} shim_procs {} mocks {} vars {}
+    }
+    array set opt [strip_comment_lines $opts]
+
+    interp create -safe -- $name
+    foreach array $opt(copy_arrays) { # inlined due to upvar
+       if { [llength $array] == 2 } {
+           upvar [lindex $array 1] src_array
+       } elseif { [llength $array] == 1 } {
+           upvar [lindex $array 0] src_array
+       } else {
+           error "bogus copy_arrays directive: $array"
+       }
+       $name eval array set [list [lindex $array 0] [array get src_array]]
+    }
+    foreach proc $opt(copy_procs) { # inlined due to uplevel
+       # proc reconstruction adapted from Tcl info(n) manpage
+       set argspec [list]
+       foreach arg [uplevel info args $proc] {
+           if { [uplevel info default $proc $arg value] } {
+               lappend argspec [list $arg $value]
+           } else {
+               lappend argspec [list $arg]
+           }
+       }
+       $name eval proc $proc [list $argspec] [list [uplevel info body $proc]]
+    }
+    foreach var $opt(copy_vars) { # inlined due to upvar
+       if { [llength $var] == 2 } {
+           upvar [lindex $var 1] src_var
+       } elseif { [llength $var] == 1 } {
+           upvar [lindex $var 0] src_var
+       } else {
+           error "bogus copy_vars directive: $var"
+       }
+       $name eval set [list [lindex $var 0] $src_var]
+    }
+    foreach {varname var} $opt(vars) {
+       $name eval set [list $varname $var]
+    }
+    foreach {mockname arglist retexpr} $opt(mocks) {
+       establish_mock $name $mockname $arglist $retexpr
+    }
+    foreach chan $opt(link_channels)   { interp share {} $chan $name }
+    foreach link $opt(link_procs)      { establish_link $name $link }
+    foreach shim $opt(shim_procs)      { establish_shim $name $shim }
+    return $name
+}
+proc copy_array_to_test_interpreter { sicmd dest {src {}} } {
+    if { $src eq {} } { set src $dest }
+    upvar $src src_array
+    $sicmd eval array set [list $dest [array get src_array]]
+}
+proc delete_test_interpreter { name } {
+    interp delete $name
+}
+
+proc reset_mock_trace {} {
+    global mock_call_trace
+    set mock_call_trace [list]
+}
+proc dump_mock_trace {} {
+    global mock_call_trace
+    puts "<<< mocked calls recorded"
+    foreach cell $mock_call_trace {
+       puts "  [lindex $cell 0]"
+       if { [llength $cell] > 1 } {
+           puts "    -> [lindex $cell 1]"
+       }
+    }
+    puts ">>> mocked calls recorded"
+}
+proc get_mock_trace {} {
+    global mock_call_trace
+    return $mock_call_trace
+}
+proc find_mock_calls { prefix } {
+    global mock_call_trace
+    set result [list]
+    foreach cell $mock_call_trace {
+       if { [string match "${prefix}*" [lindex $cell 0]] } {
+           lappend result $cell
+       }
+    }
+    return $result
+}
+
+proc relay_link_call { name args } {
+    eval [list $name] $args
+}
+proc establish_link { sicmd name } {
+    $sicmd alias $name relay_link_call $name
+}
+
+proc record_mock_call { name args } {
+    global mock_call_trace
+    lappend mock_call_trace [list [linsert $args 0 $name]]
+    return
+}
+proc establish_mock_log_alias { sicmd name } {
+    $sicmd alias logcall_$name record_mock_call $name
+}
+proc establish_mock { sicmd name arglist retexpr } {
+    establish_mock_log_alias $sicmd $name
+
+    set sargl [list]
+    foreach arg $arglist { lappend sargl [format {$%s} $arg] }
+
+    if { [lindex $arglist end] eq "args" } {
+       set log_call \
+           "eval \[list logcall_$name [join [lrange $sargl 0 end-1]]\] \$args"
+    } else {
+       set log_call \
+           "logcall_$name [join $sargl]"
+    }
+
+    $sicmd eval [subst -nocommands {
+       proc $name {$arglist} {
+           $log_call
+           return $retexpr
+       }
+    }]
+}
+
+proc relay_shim_call { name args } {
+    global mock_call_trace
+    set retval [eval [list $name] $args]
+    lappend mock_call_trace [list [linsert $args 0 $name] [list $retval]]
+    return $retval
+}
+proc establish_shim { sicmd name } {
+    $sicmd alias $name relay_shim_call $name
+}
+
+proc match_argpat { argpat call } {
+    set result 1
+    foreach {pos qre} $argpat {
+       set qre [regsub -all {\M\s+(?=[^*+?\s])} $qre {\s+}]
+       set qre [regsub -all {([*+?])\s+(?=[^*+?\s])} $qre {\1\s+} ]
+       set out [lindex $call 0 $pos]
+       verbose "matching: ^$qre$"
+       verbose " against:  $out"
+       if { ![regexp "^$qre$" $out] } { set result 0 }
+    }
+    return $result
+}
+
+proc test_proc_with_mocks { name sicmd code args } {
+    array set opt {
+       check_calls {}
+    }
+    foreach { key value } $args {
+       if { ![info exists opt($key)] } {
+           error "test_proc_with_mocks: unknown option $key"
+       }
+       set opt($key) [strip_comment_lines $value]
+    }
+
+    verbose "--------  begin test: $name"
+    reset_mock_trace
+    $sicmd eval $code
+    dump_mock_trace
+
+    set result pass
+    foreach { prefix callpos argpat } $opt(check_calls) {
+       set calls [find_mock_calls $prefix]
+
+       verbose "checking: \[$callpos\] $prefix"
+       if { $callpos eq "*" } {
+           # succeed if any call matches both prefix and argpat
+           set innerresult fail
+           foreach { call } $calls {
+               verbose "    step: [lindex $call 0]"
+               if { [match_argpat $argpat $call] } {
+                   set innerresult pass
+                   break
+               }
+           }
+           if { $innerresult ne "pass" } {
+               verbose "  failed!"
+               set result fail
+           }
+       } elseif { $callpos eq "!" } {
+           # succeed if no calls match prefix
+           if { [llength $calls] != 0 } {
+               verbose "  failed!"
+               set result fail
+           }
+       } elseif { $callpos eq "U" } {
+           # prefix selects one unique call
+           if { [llength $calls] != 1 } {
+               error "expected unique call"
+               return
+           }
+           if { ![match_argpat $argpat [lindex $calls 0]] } {
+               verbose "  failed!"
+               set result fail
+           }
+       } elseif { [llength $calls] > $callpos } {
+           if { ![match_argpat $argpat [lindex $calls $callpos]] } {
+               verbose "  failed!"
+               set result fail
+           }
+       } else {
+           error "failed to select trace record"
+           return
+       }
+    }
+
+    $result $name
+    verbose "--------    end test: $name"
+}
+
+
+#EOF
diff --git a/testsuite/runtest.libs/target.test 
b/testsuite/runtest.libs/target.test
index dd3a156..629637f 100644
--- a/testsuite/runtest.libs/target.test
+++ b/testsuite/runtest.libs/target.test
@@ -6,54 +6,42 @@ if [ file exists $srcdir/$subdir/default_procs.tcl ] {
     puts "ERROR: $srcdir/$subdir/default_procs.tcl doesn't exist"
 }
 
+if [ file exists $srcdir/$subdir/mockutil.tcl ] {
+    source $srcdir/$subdir/mockutil.tcl
+} else {
+    puts "ERROR: $srcdir/$subdir/mockutil.tcl doesn't exist"
+}
+
 proc load_lib { lib } {
      global srcdir
      source $srcdir/../lib/$lib
 }
 
-set file $srcdir/../lib/target.exp
-if [ file exists $file] {
-    source $file
-} else {
-    puts "ERROR: $file doesn't exist"
-}
-# we load framework so we can use stuff like is3way
-set file $srcdir/../lib/framework.exp
-if [ file exists $file] {
-    source $file
-} else {
-    puts "ERROR: $file doesn't exist"
-}
-# we load the remote stuff so we can test execute_anywhere
-set file $srcdir/../lib/remote.exp
-if [ file exists $file] {
-    source $file
-} else {
-    puts "ERROR: $file doesn't exist"
+foreach lib { targetdb target } {
+    set file $srcdir/../lib/${lib}.exp
+    if [ file exists $file] {
+       source $file
+    } else {
+       puts "ERROR: $file doesn't exist"
+    }
 }
 
 #
 # Create a false board config array
 #
 set board_info(idp,name)       "idp"
-set board_info(idp,ldflags)    "-Tidp.ld"
+set board_info(idp,ldscript)   "-Tidp.ld"
 set board_info(idp,config)     m68k-unknown-aout
-set board_info(idp,cflags)     ""
-set board_info(idp,connect)    "telnet"
-set board_info(idp,target)     "s12"
-set board_info(idp,serial)     "tstty12"
-set board_info(idp,netport)    "localhost:23"
-set board_info(idp,baud)       "9600"
 # MVME target
 set board_info(mvme,name)      "mvme"
-set board_info(mvme,ldflags)   "-Tmvme.ld"
+set board_info(mvme,ldscript)  "-Tmvme.ld"
 set board_info(mvme,config)    m68k-unknown-aout
-set board_info(mvme,cflags)    ""
-set board_info(mvme,connect)   "telnet"
-set board_info(mvme,target)    "s12"
-set board_info(mvme,serial)    "tstty8"
-set board_info(mvme,netport)   "localhost:23"
-set board_info(mvme,baud)      "9600"
+# testing default host
+set board_info(unix,cflags_for_target) "-DUNIX_CROSS_BUILD"
+
+#
+# Test push_config/pop_config
+#
 
 # test push_config target
 push_config target idp
@@ -86,4 +74,1262 @@ if { ![info exists target_info(host,name)] } {
     puts "FAILED: pop_config host"
 }
 
+#
+# Test default_target_compile
+#
+
+# init call trace list
+reset_mock_trace
+# build test environment
+create_test_interpreter compile_test {
+    copy_procs { default_target_compile }
+    link_procs { verbose }
+    shim_procs { board_info host_info target_info }
+    vars {
+       build_triplet   "bogus-build-host"
+       host_triplet    "bogus-test-host"
+       target_triplet  "bogus-test-target"
+    }
+    mocks {
+       # major test shims
+       which                   { what }        { $what }
+       remote_exec             { args }        { [list 0 "<exec_output>"] }
+       # minor test shims
+       prune_warnings          { text }        { $text }
+       # avoid the losing search for a libstdc++
+       isnative                { args }        { 0 }
+       # provide the special cases for C++
+       g++_include_flags       { }             { " -I/usr/include/g++" }
+       g++_link_flags          { }             { " -L/usr/lib/g++" }
+       # force local mode for initial testing
+       isremote                { args }        { 0 }
+    }
+}
+# mock find_* procedures from libgloss.exp
+foreach { prog } { gcc gcj g++ gdc g77 gfortran gnatmake nm gas ld } {
+    establish_mock compile_test find_$prog {} [list found-$prog]
+}
+
+# testing...
+# each item in testlist: { name code checks... }
+proc eval_tests { sicmd testlist } {
+    set testlist [strip_comment_lines $testlist]
+    foreach { test } $testlist {
+       if { [llength $test] > 2 } {
+           eval [list test_proc_with_mocks [lindex $test 0] $sicmd \
+                     [lindex $test 1]] [lrange $test 2 end]
+       } else {
+           $sicmd eval [lindex $test 1]
+       }
+    }
+}
+
+# set target
+push_config target idp
+
+eval_tests compile_test {
+    { "host defaults to 'unix' if not set"
+       { default_target_compile "foo.c" "foo.o" object {} }
+       check_calls {
+           "board_info unix" * { 2 exists 3 cflags_for_target }
+           "board_info unix" * { 2 cflags_for_target }
+           "remote_exec host" U
+           { 2 {found-gcc -DUNIX_CROSS_BUILD -c -o foo.o foo.c} }
+       }
+    }
+}
+
+# set host
+push_config host mvme
+
+eval_tests compile_test {
+    { "query compiler configuration"
+       # This is an example adapted from the GCC testsuite.
+       { default_target_compile "-dumpspecs" "" none {} }
+       check_calls {
+           "remote_exec host" U { 2 {found-gcc -dumpspecs\s*} }
+       }
+    }
+}
+
+eval_tests compile_test {
+    { "minimal simple preprocess"
+       { default_target_compile "foo.c" "" preprocess {} }
+       check_calls {
+           "remote_exec host" U { 2 {found-gcc foo.c -E} }
+       }
+    }
+    { "minimal simple preprocess with output redirection"
+       { default_target_compile "foo.c" "" preprocess {
+           "redirect=bar_out"
+       } }
+       check_calls {
+           "remote_exec host" U {
+               2 {found-gcc foo.c -E}
+               5 {bar_out}
+           }
+       }
+    }
+    { "minimal simple preprocess with timeout"
+       { default_target_compile "foo.c" "" preprocess {
+           "timeout=1742"
+       } }
+       check_calls {
+           "remote_exec host" U {
+               2 {found-gcc foo.c -E}
+               6 {1742}
+           }
+       }
+    }
+    { "minimal simple compile to assembly"
+       { default_target_compile "foo.c" "foo.s" assembly {} }
+       check_calls {
+           "remote_exec host" U { 2 {found-gcc foo.c -S -o foo.s} }
+       }
+    }
+    { "minimal simple compile to object"
+       { default_target_compile "foo.c" "foo.o" object {} }
+       check_calls {
+           "remote_exec host" U { 2 {found-gcc -c -o foo.o foo.c} }
+       }
+    }
+    { "minimal simple compile and link"
+       { default_target_compile "foo.c" "foo" executable {} }
+       check_calls {
+           "remote_exec host" U { 2 {found-gcc foo.c -lm -Tidp.ld -o foo} }
+       }
+    }
+    { "minimal simple compile and link with debug option"
+       { default_target_compile "foo.c" "foo" executable {debug} }
+       check_calls {
+           "remote_exec host" U { 2 {found-gcc foo.c -g -lm -Tidp.ld -o foo} }
+       }
+    }
+}
+
+# add more keys to the board_info array for a more complex target description
+set board_info(idp,cflags)             "-I/usr/gnemul/idp/include"
+set board_info(idp,compiler)           "$board_info(idp,config)-gcc"
+set board_info(idp,debug_flags)                "-ggdb"
+set board_info(idp,ldflags)            "-L/usr/gnemul/idp/lib"
+set board_info(idp,libs)               "-lidpsup"
+set board_info(idp,mathlib)            "-lm_idp"
+set board_info(idp,multilib_flags)     "-midp"
+
+eval_tests compile_test {
+    { "preprocess with target compiler"
+       { default_target_compile "foo.c" "" preprocess {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2
+             {m68k-unknown-aout-gcc foo.c -midp -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile to assembly with target compiler"
+       { default_target_compile "foo.c" "foo.s" assembly {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -S -I/usr/gnemul/idp/include
+                -o foo.s} }
+       }
+    }
+    { "compile to object with target compiler"
+       { default_target_compile "foo.c" "foo.o" object {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc -midp -c -I/usr/gnemul/idp/include
+                -o foo.o foo.c} }
+       }
+    }
+    { "compile and link with target compiler"
+       { default_target_compile "foo.c" "foo" executable {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/gnemul/idp/include
+                -L/usr/gnemul/idp/lib -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "compile and link with target compiler and target debug"
+       { default_target_compile "foo.c" "foo" executable {debug} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/gnemul/idp/include
+                -L/usr/gnemul/idp/lib -ggdb -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+}
+
+# add a few more keys for the remaining cases...
+set board_info(idp,remote_link)                idp_remote_link
+set board_info(idp,output_format)      coff
+
+eval_tests compile_test {
+    { "compile and link for remote linking"
+       { default_target_compile "foo.c" "foo" executable {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/gnemul/idp/include
+                -L/usr/gnemul/idp/lib -lidpsup -lm_idp -Tidp.ld
+                -Wl,-r -Wl,-oformat,coff -o foo} }
+       }
+    }
+    { "compile and link for remote linking with debug"
+       { default_target_compile "foo.c" "foo" executable {debug} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/gnemul/idp/include
+                -L/usr/gnemul/idp/lib -ggdb -lidpsup -lm_idp -Tidp.ld
+                -Wl,-r -Wl,-oformat,coff -o foo} }
+       }
+    }
+}
+
+# simplify by removing the most unusual options
+unset board_info(idp,remote_link) board_info(idp,output_format)
+
+eval_tests compile_test {
+    { "setup CFLAGS_FOR_TARGET"
+       { set CFLAGS_FOR_TARGET "-DTARGET_FLAG" }
+    }
+    { "preprocess with target compiler and CFLAGS_FOR_TARGET"
+       { default_target_compile "foo.c" "" preprocess {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2
+             {m68k-unknown-aout-gcc foo.c -midp -DTARGET_FLAG -E
+              -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile to assembly with target compiler and CFLAGS_FOR_TARGET"
+       { default_target_compile "foo.c" "foo.s" assembly {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -DTARGET_FLAG -S
+                -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile to object with target compiler and CFLAGS_FOR_TARGET"
+       { default_target_compile "foo.c" "foo.o" object {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc -midp -DTARGET_FLAG -c
+                -I/usr/gnemul/idp/include -o foo.o foo.c} }
+       }
+    }
+    { "compile and link with target compiler and CFLAGS_FOR_TARGET"
+       { default_target_compile "foo.c" "foo" executable {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -DTARGET_FLAG
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "clean up CFLAGS_FOR_TARGET"
+       { unset CFLAGS_FOR_TARGET }
+    }
+    { "setup LDFLAGS_FOR_TARGET"
+       { set LDFLAGS_FOR_TARGET "-ltarget" }
+    }
+    { "preprocess with target compiler and LDFLAGS_FOR_TARGET"
+       { default_target_compile "foo.c" "" preprocess {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2
+             {m68k-unknown-aout-gcc foo.c -midp -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile to assembly with target compiler and LDFLAGS_FOR_TARGET"
+       { default_target_compile "foo.c" "foo.s" assembly {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -S -I/usr/gnemul/idp/include
+                -o foo.s} }
+       }
+    }
+    { "compile to object with target compiler and LDFLAGS_FOR_TARGET"
+       { default_target_compile "foo.c" "foo.o" object {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc -midp -c -I/usr/gnemul/idp/include
+                -o foo.o foo.c} }
+       }
+    }
+    { "compile and link with target compiler and LDFLAGS_FOR_TARGET"
+       { default_target_compile "foo.c" "foo" executable {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/gnemul/idp/include
+                -L/usr/gnemul/idp/lib -ltarget -lidpsup -lm_idp -Tidp.ld
+                -o foo} }
+       }
+    }
+    { "clean up LDFLAGS_FOR_TARGET"
+       { unset LDFLAGS_FOR_TARGET }
+    }
+    { "setup CC_FOR_TARGET"
+       { set CC_FOR_TARGET "target-gcc" }
+    }
+    { "preprocess with CC_FOR_TARGET"
+       { default_target_compile "foo.c" "" preprocess {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U { 2
+             {target-gcc foo.c -midp -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile to assembly with CC_FOR_TARGET"
+       { default_target_compile "foo.c" "foo.s" assembly {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {target-gcc foo.c -midp -S -I/usr/gnemul/idp/include
+                -o foo.s} }
+       }
+    }
+    { "compile to object with CC_FOR_TARGET"
+       { default_target_compile "foo.c" "foo.o" object {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {target-gcc -midp -c -I/usr/gnemul/idp/include
+                -o foo.o foo.c} }
+       }
+    }
+    { "compile and link with CC_FOR_TARGET"
+       { default_target_compile "foo.c" "foo" executable {} }
+       check_calls {
+           "find_gcc" ! {}
+           "remote_exec host" U
+           { 2 {target-gcc foo.c -midp -I/usr/gnemul/idp/include
+                -L/usr/gnemul/idp/lib -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "clean up CC_FOR_TARGET"
+       { unset CC_FOR_TARGET }
+    }
+}
+
+eval_tests compile_test {
+    { "override destination to host and compile and link"
+       { default_target_compile "foo.c" "foo" executable {"dest=host"} }
+       check_calls {
+           "board_info host" * { 2 exists 3 name }
+           "board_info host" * { 2 name }
+           "remote_exec host" U
+           { 2 {found-gcc foo.c -lm -Tmvme.ld -o foo} }
+       }
+    }
+    { "override destination to host and compile and link with host-gcc"
+       { default_target_compile "foo.c" "foo" executable {
+           "dest=host" "compiler=host-gcc"
+       } }
+       check_calls {
+           "find_gcc" ! {}
+           "board_info host" * { 2 exists 3 name }
+           "board_info host" * { 2 name }
+           "remote_exec host" U
+           { 2 {host-gcc foo.c -lm -Tmvme.ld -o foo} }
+       }
+    }
+    { "override ldscript"
+       { default_target_compile "foo.c" "foo" executable {
+           "ldscript=-Tspecial.ld"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tspecial.ld -o foo} }
+       }
+    }
+}
+
+eval_tests compile_test {
+    { "insert additional flags"
+       { default_target_compile "foo.c" "foo" executable {
+           "additional_flags=-fextra-flag-for-test"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "insert additional flags and ldflags"
+       { default_target_compile "foo.c" "foo" executable {
+           "additional_flags=-fextra-flag-for-test"
+           "ldflags=-Wl,--extra-linker-flag"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "insert additional flags, ldflags, and incdir"
+       { default_target_compile "foo.c" "foo" executable {
+           "additional_flags=-fextra-flag-for-test"
+           "ldflags=-Wl,--extra-linker-flag"
+           "incdir=/usr/test/include"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
+                -I/usr/test/include
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "insert additional flags, ldflags, and incdirs"
+       { default_target_compile "foo.c" "foo" executable {
+           "additional_flags=-fextra-flag-for-test"
+           "ldflags=-Wl,--extra-linker-flag"
+           "incdir=/usr/test/include" "incdir=/usr/test/include2"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
+                -I/usr/test/include -I/usr/test/include2
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "insert additional flags, ldflags, incdirs, and libdir"
+       { default_target_compile "foo.c" "foo" executable {
+           "additional_flags=-fextra-flag-for-test"
+           "ldflags=-Wl,--extra-linker-flag"
+           "incdir=/usr/test/include" "incdir=/usr/test/include2"
+           "libdir=/usr/test/lib"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
+                -I/usr/test/include -I/usr/test/include2
+                -L/usr/test/lib
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "insert additional flags, ldflags, incdirs, and libdirs"
+       { default_target_compile "foo.c" "foo" executable {
+           "additional_flags=-fextra-flag-for-test"
+           "ldflags=-Wl,--extra-linker-flag"
+           "incdir=/usr/test/include" "incdir=/usr/test/include2"
+           "libdir=/usr/test/lib" "libdir=/usr/test/lib2"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
+                -I/usr/test/include -I/usr/test/include2
+                -L/usr/test/lib -L/usr/test/lib2
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "insert additional flags, ldflags, incdirs, and libdirs shuffled"
+       { default_target_compile "foo.c" "foo" executable {
+           "incdir=/usr/test/include"
+           "additional_flags=-fextra-flag-for-test"  "libdir=/usr/test/lib"
+           "ldflags=-Wl,--extra-linker-flag"
+           "additional_flags=-fanother-extra-flag"
+           "incdir=/usr/test/include2" "libdir=/usr/test/lib2"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/test/include
+                -fextra-flag-for-test -L/usr/test/lib -fanother-extra-flag
+                -I/usr/test/include2 -L/usr/test/lib2
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "previous test with optimization flag added"
+       { default_target_compile "foo.c" "foo" executable {
+           "incdir=/usr/test/include" "optimize=-O2 -foptimize"
+           "additional_flags=-fextra-flag-for-test"  "libdir=/usr/test/lib"
+           "ldflags=-Wl,--extra-linker-flag"
+           "additional_flags=-fanother-extra-flag"
+           "incdir=/usr/test/include2" "libdir=/usr/test/lib2"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/test/include
+                -fextra-flag-for-test -L/usr/test/lib -fanother-extra-flag
+                -I/usr/test/include2 -L/usr/test/lib2
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -O2 -foptimize
+                -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "previous test with optimization flag added and debugging selected"
+       { default_target_compile "foo.c" "foo" executable {
+           "incdir=/usr/test/include" "debug"
+           "additional_flags=-fextra-flag-for-test"  "libdir=/usr/test/lib"
+           "ldflags=-Wl,--extra-linker-flag" "optimize=-O2 -foptimize-debug"
+           "additional_flags=-fanother-extra-flag"
+           "incdir=/usr/test/include2" "libdir=/usr/test/lib2"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/test/include
+                -fextra-flag-for-test -L/usr/test/lib -fanother-extra-flag
+                -I/usr/test/include2 -L/usr/test/lib2
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -ggdb -O2 -foptimize-debug
+                -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+}
+
+# add more keys to the board_info array for testing other language support
+set board_info(idp,adaflags)           "-fada"
+set board_info(idp,cxxflags)           "-fgnu-c++"
+set board_info(idp,dflags)             "-fdflag"
+set board_info(idp,f77flags)           "-flong-f77-flag"
+set board_info(idp,f90flags)           "-flonger-f90-flag"
+foreach {k v} {
+    gnatmake gnatmake          c++compiler g++         dcompiler gdc
+    f77compiler g77            f90compiler gfortran
+} { set board_info(idp,$k)             "$board_info(idp,config)-$v" }
+
+eval_tests compile_test {
+
+    # Ada
+    # TODO FIXME:  These tests verify the currently-known-broken Ada support.
+    { "preprocess Ada with target compiler"
+       { default_target_compile "foo.adb" "" preprocess {ada} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gnatmake" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gnatmake foo.adb -midp -fada
+                -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile Ada to assembly with target compiler"
+       { default_target_compile "foo.adb" "foo.s" assembly {ada} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gnatmake" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gnatmake foo.adb -midp -fada
+                -S -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile Ada to object with target compiler"
+       { default_target_compile "foo.adb" "foo.o" object {ada} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gnatmake" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gnatmake -midp -fada
+                -c -I/usr/gnemul/idp/include
+                -o foo.o foo.adb} }
+       }
+    }
+    { "compile and link Ada with target compiler"
+       { default_target_compile "foo.adb" "foo" executable {ada} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gnatmake" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gnatmake foo.adb -midp -fada
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+
+    { "setup GNATMAKE_FOR_TARGET"
+       { set GNATMAKE_FOR_TARGET "target-gnatmake" }
+    }
+    { "preprocess Ada with GNATMAKE_FOR_TARGET"
+       { default_target_compile "foo.adb" "" preprocess {ada} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gnatmake" ! {}
+           "remote_exec host" U
+           { 2 {target-gnatmake foo.adb -midp -fada
+                -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile Ada to assembly with GNATMAKE_FOR_TARGET"
+       { default_target_compile "foo.adb" "foo.s" assembly {ada} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gnatmake" ! {}
+           "remote_exec host" U
+           { 2 {target-gnatmake foo.adb -midp -fada
+                -S -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile Ada to object with GNATMAKE_FOR_TARGET"
+       { default_target_compile "foo.adb" "foo.o" object {ada} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gnatmake" ! {}
+           "remote_exec host" U
+           { 2 {target-gnatmake -midp -fada
+                -c -I/usr/gnemul/idp/include
+                -o foo.o foo.adb} }
+       }
+    }
+    { "compile and link Ada with GNATMAKE_FOR_TARGET"
+       { default_target_compile "foo.adb" "foo" executable {ada} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gnatmake" ! {}
+           "remote_exec host" U
+           { 2 {target-gnatmake foo.adb -midp -fada
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "clean up GNATMAKE_FOR_TARGET"
+       { unset GNATMAKE_FOR_TARGET }
+    }
+
+    { "override destination to host and compile and link Ada"
+       { default_target_compile "foo.adb" "foo" executable {
+           "dest=host" ada
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {found-gnatmake foo.adb -lm -Tmvme.ld -o foo} }
+       }
+    }
+    { "override destination to host and compile and link Ada with 
host-gnatmake"
+       { default_target_compile "foo.adb" "foo" executable {
+           "dest=host" ada "compiler=host-gnatmake"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {host-gnatmake foo.adb -lm -Tmvme.ld -o foo} }
+       }
+    }
+
+    # C++
+    { "preprocess C++ with target compiler"
+       { default_target_compile "foo.cxx" "" preprocess {c++} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g++" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-g\+\+ foo.cxx -midp -fgnu-c\+\+
+                -I/usr/include/g\+\+ -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile C++ to assembly with target compiler"
+       { default_target_compile "foo.cxx" "foo.s" assembly {c++} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g++" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-g\+\+ foo.cxx -midp -fgnu-c\+\+
+                -I/usr/include/g\+\+ -S -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile C++ to object with target compiler"
+       { default_target_compile "foo.cxx" "foo.o" object {c++} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g++" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-g\+\+ -midp -fgnu-c\+\+
+                -I/usr/include/g\+\+ -c -I/usr/gnemul/idp/include
+                -o foo.o foo.cxx} }
+       }
+    }
+    { "compile and link C++ with target compiler"
+       { default_target_compile "foo.cxx" "foo" executable {c++} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g++" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-g\+\+ foo.cxx -midp -fgnu-c\+\+
+                -I/usr/include/g\+\+ -I/usr/gnemul/idp/include
+                -L/usr/gnemul/idp/lib -L/usr/lib/g\+\+
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+
+    { "setup CXX_FOR_TARGET"
+       { set CXX_FOR_TARGET "target-g++" }
+    }
+    { "preprocess C++ with CXX_FOR_TARGET"
+       { default_target_compile "foo.cxx" "" preprocess {c++} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g++" ! {}
+           "remote_exec host" U
+           { 2 {target-g\+\+ foo.cxx -midp -fgnu-c\+\+
+                -I/usr/include/g\+\+ -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile C++ to assembly with CXX_FOR_TARGET"
+       { default_target_compile "foo.cxx" "foo.s" assembly {c++} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g++" ! {}
+           "remote_exec host" U
+           { 2 {target-g\+\+ foo.cxx -midp -fgnu-c\+\+
+                -I/usr/include/g\+\+ -S -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile C++ to object with CXX_FOR_TARGET"
+       { default_target_compile "foo.cxx" "foo.o" object {c++} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g++" ! {}
+           "remote_exec host" U
+           { 2 {target-g\+\+ -midp -fgnu-c\+\+
+                -I/usr/include/g\+\+ -c -I/usr/gnemul/idp/include
+                -o foo.o foo.cxx} }
+       }
+    }
+    { "compile and link C++ with CXX_FOR_TARGET"
+       { default_target_compile "foo.cxx" "foo" executable {c++} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g++" ! {}
+           "remote_exec host" U
+           { 2 {target-g\+\+ foo.cxx -midp -fgnu-c\+\+
+                -I/usr/include/g\+\+ -I/usr/gnemul/idp/include
+                -L/usr/gnemul/idp/lib -L/usr/lib/g\+\+
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "clean up CXX_FOR_TARGET"
+       { unset CXX_FOR_TARGET }
+    }
+
+    { "override destination to host and compile and link C++"
+       { default_target_compile "foo.cxx" "foo" executable {
+           "dest=host" c++
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {found-g\+\+ foo.cxx -I/usr/include/g\+\+ -L/usr/lib/g\+\+
+                -lm -Tmvme.ld -o foo} }
+       }
+    }
+    { "override destination to host and compile and link C++ with host-g++"
+       { default_target_compile "foo.cxx" "foo" executable {
+           "dest=host" c++ "compiler=host-g++"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {host-g\+\+ foo.cxx -I/usr/include/g\+\+ -L/usr/lib/g\+\+
+                -lm -Tmvme.ld -o foo} }
+       }
+    }
+
+    # D
+    { "preprocess D with target compiler"
+       { default_target_compile "foo.d" "" preprocess {d} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gdc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gdc foo.d -midp -fdflag
+                -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile D to assembly with target compiler"
+       { default_target_compile "foo.d" "foo.s" assembly {d} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gdc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gdc foo.d -midp -fdflag
+                -S -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile D to object with target compiler"
+       { default_target_compile "foo.d" "foo.o" object {d} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gdc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gdc -midp -fdflag
+                -c -I/usr/gnemul/idp/include
+                -o foo.o foo.d} }
+       }
+    }
+    { "compile and link D with target compiler"
+       { default_target_compile "foo.d" "foo" executable {d} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gdc" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gdc foo.d -midp -fdflag
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+
+    { "setup D_FOR_TARGET"
+       { set D_FOR_TARGET "target-gdc" }
+    }
+    { "preprocess D with D_FOR_TARGET"
+       { default_target_compile "foo.d" "" preprocess {d} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gdc" ! {}
+           "remote_exec host" U
+           { 2 {target-gdc foo.d -midp -fdflag
+                -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile D to assembly with D_FOR_TARGET"
+       { default_target_compile "foo.d" "foo.s" assembly {d} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gdc" ! {}
+           "remote_exec host" U
+           { 2 {target-gdc foo.d -midp -fdflag
+                -S -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile D to object with D_FOR_TARGET"
+       { default_target_compile "foo.d" "foo.o" object {d} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gdc" ! {}
+           "remote_exec host" U
+           { 2 {target-gdc -midp -fdflag
+                -c -I/usr/gnemul/idp/include
+                -o foo.o foo.d} }
+       }
+    }
+    { "compile and link D with D_FOR_TARGET"
+       { default_target_compile "foo.d" "foo" executable {d} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gdc" ! {}
+           "remote_exec host" U
+           { 2 {target-gdc foo.d -midp -fdflag
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "clean up D_FOR_TARGET"
+       { unset D_FOR_TARGET }
+    }
+
+    { "override destination to host and compile and link D"
+       { default_target_compile "foo.d" "foo" executable {
+           "dest=host" d
+       } }
+       check_calls {
+           "remote_exec host" U { 2 {found-gdc foo.d -lm -Tmvme.ld -o foo} }
+       }
+    }
+    { "override destination to host and compile and link D with host-gdc"
+       { default_target_compile "foo.d" "foo" executable {
+           "dest=host" d "compiler=host-gdc"
+       } }
+       check_calls {
+           "remote_exec host" U { 2 {host-gdc foo.d -lm -Tmvme.ld -o foo} }
+       }
+    }
+
+    # Fortran 77
+    { "preprocess Fortran 77 with target compiler"
+       { default_target_compile "foo.f" "" preprocess {f77} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g77" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-g77 foo.f -midp -flong-f77-flag
+                -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile Fortran 77 to assembly with target compiler"
+       { default_target_compile "foo.f" "foo.s" assembly {f77} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g77" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-g77 foo.f -midp -flong-f77-flag
+                -S -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile Fortran 77 to object with target compiler"
+       { default_target_compile "foo.f" "foo.o" object {f77} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g77" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-g77 -midp -flong-f77-flag
+                -c -I/usr/gnemul/idp/include
+                -o foo.o foo.f} }
+       }
+    }
+    { "compile and link Fortran 77 with target compiler"
+       { default_target_compile "foo.f" "foo" executable {f77} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g77" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-g77 foo.f -midp -flong-f77-flag
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+
+    { "setup F77_FOR_TARGET"
+       { set F77_FOR_TARGET "target-g77" }
+    }
+    { "preprocess Fortran 77 with F77_FOR_TARGET"
+       { default_target_compile "foo.f" "" preprocess {f77} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g77" ! {}
+           "remote_exec host" U
+           { 2 {target-g77 foo.f -midp -flong-f77-flag
+                -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile Fortran 77 to assembly with F77_FOR_TARGET"
+       { default_target_compile "foo.f" "foo.s" assembly {f77} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g77" ! {}
+           "remote_exec host" U
+           { 2 {target-g77 foo.f -midp -flong-f77-flag
+                -S -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile Fortran 77 to object with F77_FOR_TARGET"
+       { default_target_compile "foo.f" "foo.o" object {f77} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g77" ! {}
+           "remote_exec host" U
+           { 2 {target-g77 -midp -flong-f77-flag
+                -c -I/usr/gnemul/idp/include
+                -o foo.o foo.f} }
+       }
+    }
+    { "compile and link Fortran 77 with F77_FOR_TARGET"
+       { default_target_compile "foo.f" "foo" executable {f77} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_g77" ! {}
+           "remote_exec host" U
+           { 2 {target-g77 foo.f -midp -flong-f77-flag
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "clean up F77_FOR_TARGET"
+       { unset F77_FOR_TARGET }
+    }
+
+    { "override destination to host and compile and link Fortran 77"
+       { default_target_compile "foo.f" "foo" executable {
+           "dest=host" f77
+       } }
+       check_calls {
+           "remote_exec host" U { 2 {found-g77 foo.f -lm -Tmvme.ld -o foo} }
+       }
+    }
+    { "override destination to host and compile and link Fortran 77 with 
host-g77"
+       { default_target_compile "foo.f" "foo" executable {
+           "dest=host" f77 "compiler=host-g77"
+       } }
+       check_calls {
+           "remote_exec host" U { 2 {host-g77 foo.f -lm -Tmvme.ld -o foo} }
+       }
+    }
+
+    # Fortran 90
+    { "preprocess Fortran 90 with target compiler"
+       { default_target_compile "foo.f90" "" preprocess {f90} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gfortran" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gfortran foo.f90 -midp -flonger-f90-flag
+                -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile Fortran 90 to assembly with target compiler"
+       { default_target_compile "foo.f90" "foo.s" assembly {f90} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gfortran" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gfortran foo.f90 -midp -flonger-f90-flag
+                -S -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile Fortran 90 to object with target compiler"
+       { default_target_compile "foo.f90" "foo.o" object {f90} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gfortran" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gfortran -midp -flonger-f90-flag
+                -c -I/usr/gnemul/idp/include
+                -o foo.o foo.f90} }
+       }
+    }
+    { "compile and link Fortran 90 with target compiler"
+       { default_target_compile "foo.f90" "foo" executable {f90} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gfortran" ! {}
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gfortran foo.f90 -midp -flonger-f90-flag
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+
+    { "setup F90_FOR_TARGET"
+       { set F90_FOR_TARGET "target-gfortran" }
+    }
+    { "preprocess Fortran 90 with F90_FOR_TARGET"
+       { default_target_compile "foo.f90" "" preprocess {f90} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gfortran" ! {}
+           "remote_exec host" U
+           { 2 {target-gfortran foo.f90 -midp -flonger-f90-flag
+                -E -I/usr/gnemul/idp/include} }
+       }
+    }
+    { "compile Fortran 90 to assembly with F90_FOR_TARGET"
+       { default_target_compile "foo.f90" "foo.s" assembly {f90} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gfortran" ! {}
+           "remote_exec host" U
+           { 2 {target-gfortran foo.f90 -midp -flonger-f90-flag
+                -S -I/usr/gnemul/idp/include -o foo.s} }
+       }
+    }
+    { "compile Fortran 90 to object with F90_FOR_TARGET"
+       { default_target_compile "foo.f90" "foo.o" object {f90} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gfortran" ! {}
+           "remote_exec host" U
+           { 2 {target-gfortran -midp -flonger-f90-flag
+                -c -I/usr/gnemul/idp/include
+                -o foo.o foo.f90} }
+       }
+    }
+    { "compile and link Fortran 90 with F90_FOR_TARGET"
+       { default_target_compile "foo.f90" "foo" executable {f90} }
+       check_calls {
+           "find_gcc" ! {}
+           "find_gfortran" ! {}
+           "remote_exec host" U
+           { 2 {target-gfortran foo.f90 -midp -flonger-f90-flag
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "clean up F90_FOR_TARGET"
+       { unset F90_FOR_TARGET }
+    }
+
+    { "override destination to host and compile and link Fortran 77"
+       { default_target_compile "foo.f90" "foo" executable {
+           "dest=host" f90
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {found-gfortran foo.f90 -lm -Tmvme.ld -o foo} }
+       }
+    }
+    { "override destination to host and compile and link Fortran 90 with 
host-gfortran"
+       { default_target_compile "foo.f90" "foo" executable {
+           "dest=host" f90 "compiler=host-gfortran"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {host-gfortran foo.f90 -lm -Tmvme.ld -o foo} }
+       }
+    }
+
+}
+
+# mock [file exists ...] in slave interpreter for testing libs= option
+establish_mock_log_alias compile_test file
+compile_test eval {
+    proc file { op name } {
+       logcall_file $op $name
+       if { $op eq "exists" } {
+           if { $name eq "bar_src" } {
+               return 1
+           } else {
+               return 0
+           }
+       } else {
+           error "unimplemented"
+       }
+    }
+}
+
+eval_tests compile_test {
+    { "test libs= as linker option"
+       { default_target_compile "foo.c" "foo" executable {
+           "libs=-lbar"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c -midp
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lbar -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+    { "test libs= as extra source"
+       { default_target_compile "foo.c" "foo" executable {
+           "libs=bar_src"
+       } }
+       check_calls {
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc foo.c bar_src -midp
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o foo} }
+       }
+    }
+}
+
+delete_test_interpreter compile_test
+
+create_test_interpreter compile_remote_test {
+    copy_procs { default_target_compile }
+    link_procs { verbose }
+    shim_procs { board_info host_info target_info }
+    vars {
+       build_triplet   "bogus-build-host"
+       host_triplet    "bogus-test-host"
+       target_triplet  "bogus-test-target"
+    }
+    mocks {
+       # major test shims
+       which                   { what }          { $what }
+       remote_download         { where what }    { "remote-$what" }
+       remote_exec             { args }          { [list 0 "<exec_output>"] }
+       remote_file             { where op what } { [list $op $what] }
+       remote_upload           { where what to } { [list $what $to] }
+       # minor test shims
+       prune_warnings          { text }          { $text }
+       # avoid the losing search for a libstdc++
+       isnative                { args }          { 0 }
+       # provide the special cases for C++
+       g++_include_flags       { }               { " -I/usr/include/g++" }
+       g++_link_flags          { }               { " -L/usr/lib/g++" }
+       # force remote mode for remote testing
+       isremote                { args }          { 1 }
+       # catch writing "atfile"
+       open                    { what how }      { "iofile0" }
+       close                   { what }          { "" }
+       puts                    { args }          { "" }
+    }
+}
+# mock find_* procedures from libgloss.exp
+foreach { prog } { gcc gcj g++ gdc g77 gfortran gnatmake nm gas ld } {
+    establish_mock compile_remote_test find_$prog {} [list found-$prog]
+}
+
+eval_tests compile_remote_test {
+    { "simple remote preprocess"
+       { default_target_compile "foo.c" "foo.i" preprocess {} }
+       check_calls {
+           "which" ! {}
+           "remote_download host" U { 2 foo.c }
+           "remote_file host" 0 { 2 delete 3 a.out }
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc remote-foo.c -midp -E
+                -I/usr/gnemul/idp/include -o a.out} }
+           "remote_upload host" U { 2 a.out 3 foo.i }
+           "remote_file host" 1 { 2 delete 3 a.out }
+       }
+    }
+    { "simple remote compile and link"
+       { default_target_compile "foo.c bar.c" "foobar" executable {} }
+       check_calls {
+           "which" ! {}
+           "remote_download host" 0 { 2 foo.c }
+           "remote_download host" 1 { 2 bar.c }
+           "remote_file host" 0 { 2 delete 3 a.out }
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc remote-foo.c remote-bar.c -midp
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o a.out} }
+           "remote_upload host" U { 2 a.out 3 foobar }
+           "remote_file host" 1 { 2 delete 3 a.out }
+       }
+    }
+}
+
+set board_info(mvme,use_at)    1
+
+eval_tests compile_remote_test {
+    { "simple remote preprocess with atfile"
+       { default_target_compile "foo.c" "foo.i" preprocess {} }
+       check_calls {
+           "which" ! {}
+           "remote_download host" 0 { 2 foo.c }
+           "remote_file host" 0 { 2 delete 3 a.out }
+           "open atfile w" U { 1 atfile }
+           "puts iofile0" U
+           { 2 {\s*remote-foo.c -midp -E -I/usr/gnemul/idp/include -o a.out} }
+           "close iofile0" U { 1 iofile0 }
+           "remote_download host" 1 { 2 atfile }
+           "remote_file build delete" U { 3 atfile }
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc @remote-atfile} }
+           "remote_upload host" U { 2 a.out 3 foo.i }
+           "remote_file host" 1 { 2 delete 3 a.out }
+       }
+    }
+    { "simple remote compile and link with atfile"
+       { default_target_compile "foo.c bar.c" "foobar" executable {} }
+       check_calls {
+           "which" ! {}
+           "remote_download host" 0 { 2 foo.c }
+           "remote_download host" 1 { 2 bar.c }
+           "remote_file host" 0 { 2 delete 3 a.out }
+           "open atfile w" U { 1 atfile }
+           "puts iofile0" U
+           { 2 {\s*remote-foo.c remote-bar.c -midp
+                -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
+                -lidpsup -lm_idp -Tidp.ld -o a.out} }
+           "close iofile0" U { 1 iofile0 }
+           "remote_download host" 2 { 2 atfile }
+           "remote_file build delete" U { 3 atfile }
+           "remote_exec host" U
+           { 2 {m68k-unknown-aout-gcc @remote-atfile} }
+           "remote_upload host" U { 2 a.out 3 foobar }
+           "remote_file host" 1 { 2 delete 3 a.out }
+       }
+    }
+}
+
+delete_test_interpreter compile_remote_test
+
 puts "END target.test"
-- 
1.7.4.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]