tested on x86_64-darwin21 with an updated compiler that does not support the path concatentation and on an unpatched trunk. OK for trunk? thanks Iain
--- 8< --- The original implementation for Modula-2 search paths allows things like '-I/path/a:/path/b'. Such paths are not compatible with the rest of the compiler (in particular, the preprocessor, which Modula-2 uses). In preparation for removing that idiom, this patch rewrites the cases in the testsuite and removes string processing where possible from lists of paths. TODO: There are some apparent discrepancies and/or extraneous insertions of partial include paths (especially in gm2_init_log, gm2_init_iso and gm2_init_pim) - to be handled in some future patch. Signed-off-by: Iain Sandoe <i...@sandoe.co.uk> gcc/testsuite/ChangeLog: * gm2/case/pass/case-pass.exp: Update for removal of concatenated paths. * gm2/complex/pass/complex-pass.exp: Likewise. * gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp: Likewise. * gm2/iso/analysis/fail/iso-analysis-fail.xp: Likewise. * gm2/iso/check/fail/iso-check-fail.exp: Likewise. * gm2/iso/fail/iso-fail.exp: Likewise. * gm2/iso/pass/iso-pass.exp: Likewise. * gm2/isolib/run/pass/isolib-run-pass.exp: Likewise. * gm2/pim/fail/pim-fail.exp: Likewise. * gm2/pim/pass/pim-pass.exp: Likewise. * gm2/pimlib/logitech/run/pass/pimlib-logitech-run-pass.exp: Likewise. * gm2/pimlib/pass/pimlib-pass.exp: Likewise. * gm2/pimlib/run/pass/pimlib-run-pass.exp: Likewise. * gm2/projects/iso/run/pass/halma/projects-iso-run-pass-halma.exp: Likewise. * gm2/projects/iso/run/pass/hello/projects-iso-run-pass-hello.exp: Likewise. * gm2/projects/log/run/pass/hello/projects-log-run-pass-hello.exp: Likewise. * gm2/projects/pim/run/pass/hello/projects-pim-run-pass-hello.exp: Likewise. * gm2/recover/pass/recover-pass.exp: Likewise. * gm2/switches/makeall/fail/switches-makeall-fail.exp: Likewise. * gm2/switches/makeall/pass/switches-makeall-pass.exp: Likewise. * gm2/switches/none/run/pass/gm2-none.exp: Likewise. * gm2/switches/pim2/run/pass/switches-pim2-run-pass.exp: Likewise. * gm2/ulmlib/pass/ulmlib-pass.exp: Likewise. * gm2/ulmlib/std/pass/ulmlib-std-pass.exp: Likewise. * gm2/ulmlib/sys/pass/ulmlib-sys-pass.exp: Likewise. * lib/gm2.exp: Make the paths list a mandatory entry for each gm2_init_xxx function. Remove the use of concatenated include and library paths. Remove string processing where possible. --- gcc/testsuite/gm2/case/pass/case-pass.exp | 2 +- .../gm2/complex/pass/complex-pass.exp | 2 +- .../pim/run/pass/coroutines-pim-run-pass.exp | 2 +- .../iso/analysis/fail/iso-analysis-fail.exp | 2 +- .../gm2/iso/check/fail/iso-check-fail.exp | 2 +- gcc/testsuite/gm2/iso/fail/iso-fail.exp | 2 +- gcc/testsuite/gm2/iso/pass/iso-pass.exp | 2 +- .../gm2/isolib/run/pass/isolib-run-pass.exp | 2 +- gcc/testsuite/gm2/pim/fail/pim-fail.exp | 2 +- gcc/testsuite/gm2/pim/pass/pim-pass.exp | 2 +- .../run/pass/pimlib-logitech-run-pass.exp | 2 +- gcc/testsuite/gm2/pimlib/pass/pimlib-pass.exp | 2 +- .../gm2/pimlib/run/pass/pimlib-run-pass.exp | 2 +- .../halma/projects-iso-run-pass-halma.exp | 2 +- .../hello/projects-iso-run-pass-hello.exp | 2 +- .../hello/projects-log-run-pass-hello.exp | 3 +- .../hello/projects-pim-run-pass-hello.exp | 2 +- .../gm2/recover/pass/recover-pass.exp | 2 +- .../makeall/fail/switches-makeall-fail.exp | 2 +- .../makeall/pass/switches-makeall-pass.exp | 2 +- .../gm2/switches/none/run/pass/gm2-none.exp | 2 +- .../pim2/run/pass/switches-pim2-run-pass.exp | 2 +- gcc/testsuite/gm2/ulmlib/pass/ulmlib-pass.exp | 2 +- .../gm2/ulmlib/std/pass/ulmlib-std-pass.exp | 2 +- .../gm2/ulmlib/sys/pass/ulmlib-sys-pass.exp | 2 +- gcc/testsuite/lib/gm2.exp | 325 ++++++++++-------- 26 files changed, 200 insertions(+), 176 deletions(-) diff --git a/gcc/testsuite/gm2/case/pass/case-pass.exp b/gcc/testsuite/gm2/case/pass/case-pass.exp index 9c7211b2b5a..e73e4b4e073 100644 --- a/gcc/testsuite/gm2/case/pass/case-pass.exp +++ b/gcc/testsuite/gm2/case/pass/case-pass.exp @@ -25,7 +25,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_pim ${srcdir}/gm2/case/pass; +gm2_init_pim "${srcdir}/gm2/case/pass" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/complex/pass/complex-pass.exp b/gcc/testsuite/gm2/complex/pass/complex-pass.exp index 91d8323ba80..a661be1be56 100644 --- a/gcc/testsuite/gm2/complex/pass/complex-pass.exp +++ b/gcc/testsuite/gm2/complex/pass/complex-pass.exp @@ -25,7 +25,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_iso +gm2_init_iso "" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp b/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp index 81580cee973..92ed8d8b8ef 100644 --- a/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp +++ b/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp @@ -28,7 +28,7 @@ load_lib timeout-dg.exp set gm2src ${srcdir}/../gm2 -gm2_init_cor +gm2_init_cor "" # We should be able to compile, link or run in 15 seconds. gm2_push_timeout 15 diff --git a/gcc/testsuite/gm2/iso/analysis/fail/iso-analysis-fail.exp b/gcc/testsuite/gm2/iso/analysis/fail/iso-analysis-fail.exp index 7a68c80288d..a6c050f0ddc 100644 --- a/gcc/testsuite/gm2/iso/analysis/fail/iso-analysis-fail.exp +++ b/gcc/testsuite/gm2/iso/analysis/fail/iso-analysis-fail.exp @@ -24,7 +24,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_iso ${srcdir}/gm2/iso/fail:${srcdir}/gm2/iso/pass "-fsoft-check-all -O2" +gm2_init_iso "${srcdir}/gm2/iso/fail:${srcdir}/gm2/iso/pass" "-fsoft-check-all -O2" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/iso/check/fail/iso-check-fail.exp b/gcc/testsuite/gm2/iso/check/fail/iso-check-fail.exp index cca7ef28e8b..69a1fef6b03 100644 --- a/gcc/testsuite/gm2/iso/check/fail/iso-check-fail.exp +++ b/gcc/testsuite/gm2/iso/check/fail/iso-check-fail.exp @@ -44,7 +44,7 @@ set TORTURE_OPTIONS [list \ { -O3 -fsoft-check-all } \ { -O3 -g -fsoft-check-all } ] -gm2_init_iso ${srcdir}/gm2/iso/check/fail +gm2_init_iso "${srcdir}/gm2/iso/check/fail" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/iso/fail/iso-fail.exp b/gcc/testsuite/gm2/iso/fail/iso-fail.exp index 19dcf310e30..5e442d629f7 100644 --- a/gcc/testsuite/gm2/iso/fail/iso-fail.exp +++ b/gcc/testsuite/gm2/iso/fail/iso-fail.exp @@ -24,7 +24,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_iso ${srcdir}/gm2/iso/fail:${srcdir}/gm2/iso/pass +gm2_init_iso "${srcdir}/gm2/iso/fail ${srcdir}/gm2/iso/pass" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/iso/pass/iso-pass.exp b/gcc/testsuite/gm2/iso/pass/iso-pass.exp index 657e88a8356..24c7cd3c063 100644 --- a/gcc/testsuite/gm2/iso/pass/iso-pass.exp +++ b/gcc/testsuite/gm2/iso/pass/iso-pass.exp @@ -24,7 +24,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_iso ${srcdir}/gm2/iso/pass -fcpp; +gm2_init_iso "${srcdir}/gm2/iso/pass" -fcpp foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/isolib/run/pass/isolib-run-pass.exp b/gcc/testsuite/gm2/isolib/run/pass/isolib-run-pass.exp index 5575c5068b5..46ab2fe012d 100644 --- a/gcc/testsuite/gm2/isolib/run/pass/isolib-run-pass.exp +++ b/gcc/testsuite/gm2/isolib/run/pass/isolib-run-pass.exp @@ -27,7 +27,7 @@ load_lib gm2-torture.exp set gm2src ${srcdir}/../gm2 -gm2_init_iso "-I${srcdir}/gm2/iso/run/pass" +gm2_init_iso "${srcdir}/gm2/iso/run/pass" set cmd [exec cp $srcdir/$subdir/testinput .] set cmd [exec cp $srcdir/$subdir/testnumber .] diff --git a/gcc/testsuite/gm2/pim/fail/pim-fail.exp b/gcc/testsuite/gm2/pim/fail/pim-fail.exp index 92e82cb3981..febf7a3f615 100644 --- a/gcc/testsuite/gm2/pim/fail/pim-fail.exp +++ b/gcc/testsuite/gm2/pim/fail/pim-fail.exp @@ -24,7 +24,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_pim "${srcdir}/gm2/pim/fail:${srcdir}/gm2/pim/pass" +gm2_init_pim "${srcdir}/gm2/pim/fail ${srcdir}/gm2/pim/pass" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/pim/pass/pim-pass.exp b/gcc/testsuite/gm2/pim/pass/pim-pass.exp index e63297e36db..6325edf966e 100644 --- a/gcc/testsuite/gm2/pim/pass/pim-pass.exp +++ b/gcc/testsuite/gm2/pim/pass/pim-pass.exp @@ -26,7 +26,7 @@ load_lib gm2-torture.exp set gm2src ${srcdir}/../m2 -gm2_init_log "${srcdir}/gm2/pim/pass:${gm2src}/gm2-compiler:${gm2src}/gm2-gcc" +gm2_init_log "${srcdir}/gm2/pim/pass ${gm2src}/gm2-compiler ${gm2src}/gm2-gcc" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/pimlib/logitech/run/pass/pimlib-logitech-run-pass.exp b/gcc/testsuite/gm2/pimlib/logitech/run/pass/pimlib-logitech-run-pass.exp index cfe9ff84a08..2b530a55b35 100644 --- a/gcc/testsuite/gm2/pimlib/logitech/run/pass/pimlib-logitech-run-pass.exp +++ b/gcc/testsuite/gm2/pimlib/logitech/run/pass/pimlib-logitech-run-pass.exp @@ -27,7 +27,7 @@ load_lib gm2-torture.exp set gm2src ${srcdir}/../m2 -gm2_init_log +gm2_init_log "" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/pimlib/pass/pimlib-pass.exp b/gcc/testsuite/gm2/pimlib/pass/pimlib-pass.exp index 22a679f5831..3c11646e294 100644 --- a/gcc/testsuite/gm2/pimlib/pass/pimlib-pass.exp +++ b/gcc/testsuite/gm2/pimlib/pass/pimlib-pass.exp @@ -25,7 +25,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_log +gm2_init_log "" foreach testcase [lsort [glob -nocomplain $srcdir/../gm2/gm2-libs-pim/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/pimlib/run/pass/pimlib-run-pass.exp b/gcc/testsuite/gm2/pimlib/run/pass/pimlib-run-pass.exp index cfe9ff84a08..2b530a55b35 100644 --- a/gcc/testsuite/gm2/pimlib/run/pass/pimlib-run-pass.exp +++ b/gcc/testsuite/gm2/pimlib/run/pass/pimlib-run-pass.exp @@ -27,7 +27,7 @@ load_lib gm2-torture.exp set gm2src ${srcdir}/../m2 -gm2_init_log +gm2_init_log "" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/projects/iso/run/pass/halma/projects-iso-run-pass-halma.exp b/gcc/testsuite/gm2/projects/iso/run/pass/halma/projects-iso-run-pass-halma.exp index b943798e709..faec3f92902 100644 --- a/gcc/testsuite/gm2/projects/iso/run/pass/halma/projects-iso-run-pass-halma.exp +++ b/gcc/testsuite/gm2/projects/iso/run/pass/halma/projects-iso-run-pass-halma.exp @@ -27,7 +27,7 @@ load_lib gm2-torture.exp set gm2src ${srcdir}/../m2 -gm2_init_iso +gm2_init_iso "" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/projects/iso/run/pass/hello/projects-iso-run-pass-hello.exp b/gcc/testsuite/gm2/projects/iso/run/pass/hello/projects-iso-run-pass-hello.exp index b943798e709..faec3f92902 100644 --- a/gcc/testsuite/gm2/projects/iso/run/pass/hello/projects-iso-run-pass-hello.exp +++ b/gcc/testsuite/gm2/projects/iso/run/pass/hello/projects-iso-run-pass-hello.exp @@ -27,7 +27,7 @@ load_lib gm2-torture.exp set gm2src ${srcdir}/../m2 -gm2_init_iso +gm2_init_iso "" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/projects/log/run/pass/hello/projects-log-run-pass-hello.exp b/gcc/testsuite/gm2/projects/log/run/pass/hello/projects-log-run-pass-hello.exp index 36e402df571..375af707a33 100644 --- a/gcc/testsuite/gm2/projects/log/run/pass/hello/projects-log-run-pass-hello.exp +++ b/gcc/testsuite/gm2/projects/log/run/pass/hello/projects-log-run-pass-hello.exp @@ -27,8 +27,7 @@ load_lib gm2-torture.exp set gm2src ${srcdir}/../m2 -# gm2_link_lib "m2log m2pim m2iso" -gm2_init_log +gm2_init_log "" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/projects/pim/run/pass/hello/projects-pim-run-pass-hello.exp b/gcc/testsuite/gm2/projects/pim/run/pass/hello/projects-pim-run-pass-hello.exp index 0737b908a25..3e8db4709ab 100644 --- a/gcc/testsuite/gm2/projects/pim/run/pass/hello/projects-pim-run-pass-hello.exp +++ b/gcc/testsuite/gm2/projects/pim/run/pass/hello/projects-pim-run-pass-hello.exp @@ -27,7 +27,7 @@ load_lib gm2-torture.exp set gm2src ${srcdir}/../m2 -gm2_init_pim +gm2_init_pim "" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/recover/pass/recover-pass.exp b/gcc/testsuite/gm2/recover/pass/recover-pass.exp index 22a679f5831..3c11646e294 100644 --- a/gcc/testsuite/gm2/recover/pass/recover-pass.exp +++ b/gcc/testsuite/gm2/recover/pass/recover-pass.exp @@ -25,7 +25,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_log +gm2_init_log "" foreach testcase [lsort [glob -nocomplain $srcdir/../gm2/gm2-libs-pim/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/switches/makeall/fail/switches-makeall-fail.exp b/gcc/testsuite/gm2/switches/makeall/fail/switches-makeall-fail.exp index 91787df6e5e..32da0ec9119 100644 --- a/gcc/testsuite/gm2/switches/makeall/fail/switches-makeall-fail.exp +++ b/gcc/testsuite/gm2/switches/makeall/fail/switches-makeall-fail.exp @@ -29,7 +29,7 @@ load_lib gm2-torture.exp # attempts to use gm2 -fmakeall to build a syntactally incorrect program. # -gm2_init "-I$srcdir/../gm2/gm2-libs:$srcdir/gm2/switches/makeall/fail -fmakeall" +gm2_init "$srcdir/../gm2/gm2-libs $srcdir/gm2/switches/makeall/fail" -fmakeall foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { diff --git a/gcc/testsuite/gm2/switches/makeall/pass/switches-makeall-pass.exp b/gcc/testsuite/gm2/switches/makeall/pass/switches-makeall-pass.exp index 7b6d82f9080..41308af42c5 100644 --- a/gcc/testsuite/gm2/switches/makeall/pass/switches-makeall-pass.exp +++ b/gcc/testsuite/gm2/switches/makeall/pass/switches-makeall-pass.exp @@ -24,7 +24,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init "-I${srcdir}/gm2/switches/makeall/pass" -fmakeall +gm2_init "${srcdir}/gm2/switches/makeall/pass" -fmakeall gm2_init_pim4 "${srcdir}/gm2/switches/makeall/pass" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { diff --git a/gcc/testsuite/gm2/switches/none/run/pass/gm2-none.exp b/gcc/testsuite/gm2/switches/none/run/pass/gm2-none.exp index cf77d5a7840..86dab20e488 100644 --- a/gcc/testsuite/gm2/switches/none/run/pass/gm2-none.exp +++ b/gcc/testsuite/gm2/switches/none/run/pass/gm2-none.exp @@ -26,7 +26,7 @@ load_lib gm2-simple.exp set gm2src ${srcdir}/../m2 -gm2_init_pim +gm2_init_pim "" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/switches/pim2/run/pass/switches-pim2-run-pass.exp b/gcc/testsuite/gm2/switches/pim2/run/pass/switches-pim2-run-pass.exp index 135a3d638f7..04a32c681b8 100644 --- a/gcc/testsuite/gm2/switches/pim2/run/pass/switches-pim2-run-pass.exp +++ b/gcc/testsuite/gm2/switches/pim2/run/pass/switches-pim2-run-pass.exp @@ -27,7 +27,7 @@ load_lib gm2-torture.exp set gm2src ${srcdir}/../m2 -gm2_init_pim2 +gm2_init_pim2 "" foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/ulmlib/pass/ulmlib-pass.exp b/gcc/testsuite/gm2/ulmlib/pass/ulmlib-pass.exp index 0bda86671b4..0e17dde09ec 100644 --- a/gcc/testsuite/gm2/ulmlib/pass/ulmlib-pass.exp +++ b/gcc/testsuite/gm2/ulmlib/pass/ulmlib-pass.exp @@ -25,7 +25,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_ulm +gm2_init_ulm "" foreach testcase [lsort [glob -nocomplain $srcdir/../gm2/ulm-lib-gm2/sys/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/ulmlib/std/pass/ulmlib-std-pass.exp b/gcc/testsuite/gm2/ulmlib/std/pass/ulmlib-std-pass.exp index be010295228..8aea1073ef0 100644 --- a/gcc/testsuite/gm2/ulmlib/std/pass/ulmlib-std-pass.exp +++ b/gcc/testsuite/gm2/ulmlib/std/pass/ulmlib-std-pass.exp @@ -25,7 +25,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_ulm +gm2_init_ulm "" foreach testcase [lsort [glob -nocomplain $srcdir/../gm2/ulm-lib-gm2/std/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/gm2/ulmlib/sys/pass/ulmlib-sys-pass.exp b/gcc/testsuite/gm2/ulmlib/sys/pass/ulmlib-sys-pass.exp index 0bda86671b4..0e17dde09ec 100644 --- a/gcc/testsuite/gm2/ulmlib/sys/pass/ulmlib-sys-pass.exp +++ b/gcc/testsuite/gm2/ulmlib/sys/pass/ulmlib-sys-pass.exp @@ -25,7 +25,7 @@ if $tracelevel then { # load support procs load_lib gm2-torture.exp -gm2_init_ulm +gm2_init_ulm "" foreach testcase [lsort [glob -nocomplain $srcdir/../gm2/ulm-lib-gm2/sys/*.mod]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc/testsuite/lib/gm2.exp b/gcc/testsuite/lib/gm2.exp index 41a2fa03bef..15e3729e5a3 100644 --- a/gcc/testsuite/lib/gm2.exp +++ b/gcc/testsuite/lib/gm2.exp @@ -65,22 +65,22 @@ proc gm2_pop_timeout { } { proc default_gcc_version { } { global GCC_UNDER_TEST - gm2_init; + gm2_init # ignore any arguments after the command set compiler [lindex $GCC_UNDER_TEST 0] if ![is_remote host] { - set compiler_name [which $compiler]; + set compiler_name [which $compiler] } else { - set compiler_name $compiler; + set compiler_name $compiler } # verify that the compiler exists if { $compiler_name != 0 } then { set tmp [remote_exec host "$compiler --version"] - set status [lindex $tmp 0]; - set output [lindex $tmp 1]; + set status [lindex $tmp 0] + set output [lindex $tmp 1] regexp "version.*$" $output version if { $status == 0 && [info exists version] } then { clone_output "$compiler_name $version\n" @@ -98,7 +98,7 @@ proc default_gcc_version { } { # proc gcc_version { } { - default_gcc_version; + default_gcc_version } # @@ -108,64 +108,64 @@ proc gcc_version { } { # make some enhancements without having to go back and rewrite the scripts. # -set gm2_initialized 0; -set gm2_compile_method "default"; -set gm2_link_path ""; -set gm2_link_libraries "m2pim m2iso"; -set gm2_link_objects ""; +set gm2_initialized 0 +set gm2_compile_method "default" +set gm2_link_path "" +set gm2_link_libraries "m2pim m2iso" +set gm2_link_objects "" proc gm2_set_compile_method { arg } { - global gm2_compile_method; + global gm2_compile_method send_log "********************************************\n" send_log "**** setting gm2_compile_method to $arg ****\n" send_log "********************************************\n" - set gm2_compile_method $arg; + set gm2_compile_method $arg } proc gm2_init { args } { - global tmpdir; - global objdir; - global rootme; - global base_dir; - global tool_root_dir; - global gluefile wrap_flags; - global gm2_initialized; - global GCC_UNDER_TEST; - global TOOL_EXECUTABLE; - global gm2_link_libraries; - global gm2_link_objects; - global gm2_link_path; - global HAVE_LIBSTDCXX_V3; - - if { $gm2_initialized == 1 } { return; } - - set gm2_link_objects ""; - set GCC_UNDER_TEST [lookfor_file $rootme gm2]; - append GCC_UNDER_TEST " " -B[file dirname $rootme]/gcc " " ${args}; + global tmpdir + global objdir + global rootme + global base_dir + global tool_root_dir + global gluefile wrap_flags + global gm2_initialized + global GCC_UNDER_TEST + global TOOL_EXECUTABLE + global gm2_link_libraries + global gm2_link_objects + global gm2_link_path + global HAVE_LIBSTDCXX_V3 + + if { $gm2_initialized == 1 } { return } + + set gm2_link_objects "" + set GCC_UNDER_TEST [lookfor_file $rootme gm2] + append GCC_UNDER_TEST " " -B[file dirname $rootme]/gcc " " ${args} append GCC_UNDER_TEST " " -fno-diagnostics-show-caret append GCC_UNDER_TEST " " -fno-diagnostics-show-line-numbers append GCC_UNDER_TEST " " -fdiagnostics-color=never send_log "GCC_UNDER_TEST is ${GCC_UNDER_TEST}\n" if ![info exists tmpdir] then { - set tmpdir /tmp; + set tmpdir /tmp } if {[target_info needs_status_wrapper] != "" && \ [target_info needs_status_wrapper] != "0" && \ ![info exists gluefile]} { - set gluefile ${tmpdir}/gcc-testglue.o; - set result [build_wrapper $gluefile]; + set gluefile ${tmpdir}/gcc-testglue.o + set result [build_wrapper $gluefile] if { $result != "" } { - set gluefile [lindex $result 0]; - set wrap_flags [lindex $result 1]; + set gluefile [lindex $result 0] + set wrap_flags [lindex $result 1] } else { unset gluefile } } - set gm2_link_path "[gm2_link_flags [get_multilibs]]"; + set gm2_link_path "[gm2_link_flags [get_multilibs]]" verbose $gm2_link_path 1 # Set the default timeout value, larger tests can override @@ -231,7 +231,7 @@ proc gm2_target_compile_default { source dest type options } { # proc gm2_target_compile { source dest type options } { - global gm2_compile_method; + global gm2_compile_method return [gm2_target_compile_${gm2_compile_method} $source $dest $type $options] } @@ -242,9 +242,9 @@ proc gm2_target_compile { source dest type options } { # proc gm2_link_lib { libraries } { - global gm2_link_libraries; + global gm2_link_libraries - set gm2_link_libraries $libraries; + set gm2_link_libraries $libraries } @@ -253,9 +253,9 @@ proc gm2_link_lib { libraries } { # proc gm2_link_obj { objects } { - global gm2_link_objects; + global gm2_link_objects - set gm2_link_objects $objects; + set gm2_link_objects $objects } @@ -264,10 +264,10 @@ proc gm2_link_obj { objects } { # proc gm2_link_flags { paths } { - global srcdir; - global ld_library_path; - global gccpath; - global gm2_link_libraries; + global srcdir + global ld_library_path + global gccpath + global gm2_link_libraries set gccpath ${paths} set libio_dir "" @@ -329,31 +329,37 @@ proc gm2_link_flags { paths } { # # -proc gm2_init_pimx { dialect {path ""} args } { - global srcdir; - global gccpath; +proc gm2_init_pimx { dialect paths args } { + global srcdir + global gccpath - set gm2src ${srcdir}/../m2; + set gm2src ${srcdir}/../m2 + send_log "srcdir is $srcdir\n" send_log "gccpath is $gccpath\n" send_log "gm2src is $gm2src\n" - set pimIpath "${gccpath}/libgm2/libm2pim:${gm2src}/gm2-libs"; - set pimLpath "${gccpath}/libgm2/libm2pim/.libs"; + set theIpath -I${gccpath}/libgm2/libm2pim + lappend theIpath -I${gm2src}/gm2-libs-pim - set isoIpath "${gccpath}/libgm2/libm2iso:${gm2src}/gm2-libs-iso"; - set isoLpath "${gccpath}/libgm2/libm2iso/.libs"; + # NOTE: + lappend theIpath -I${gm2src}/gm2-libs + + set theLpath -L${gccpath}/libgm2/libm2pim/.libs - set theIpath "-I${pimIpath} -I${isoIpath}"; - set theLpath "-L${pimLpath} -L${isoLpath}"; + lappend theIpath -I${gccpath}/libgm2/libm2iso + lappend theIpath -I${gm2src}/gm2-libs-iso - if { $path != "" } then { - append theIpath " -I" - append theIpath ${path} + lappend theLpath -L${gccpath}/libgm2/libm2iso/.libs + + foreach p $paths { + lappend theIpath -I$p } + gm2_link_lib "m2pim m2iso" - gm2_init {*}${theIpath} {*}${dialect} {*}${theLpath} {*}${args}; + lappend args -fno-libs=- + gm2_init {*}${theIpath} {*}${dialect} {*}${theLpath} {*}${args} } # @@ -361,8 +367,8 @@ proc gm2_init_pimx { dialect {path ""} args } { # # -proc gm2_init_pim { {path ""} args } { - gm2_init_pimx -fpim {*}${path} {*}${args}; +proc gm2_init_pim { paths args } { + gm2_init_pimx -fpim $paths {*}${args} } @@ -371,8 +377,8 @@ proc gm2_init_pim { {path ""} args } { # It uses the PIM2 dialect. # -proc gm2_init_pim2 { {path ""} args } { - gm2_init_pimx -fpim2 {*}${path} {*}${args}; +proc gm2_init_pim2 { paths args } { + gm2_init_pimx -fpim2 $paths {*}${args} } @@ -381,8 +387,8 @@ proc gm2_init_pim2 { {path ""} args } { # It uses the PIM3 dialect. # -proc gm2_init_pim3 { {path ""} args } { - gm2_init_pimx -fpim3 {*}${path} {*}${args}; +proc gm2_init_pim3 { paths args } { + gm2_init_pimx -fpim3 $paths {*}${args} } @@ -391,8 +397,8 @@ proc gm2_init_pim3 { {path ""} args } { # It uses the PIM4 dialect. # -proc gm2_init_pim4 { {path ""} args } { - gm2_init_pimx -fpim4 {*}${path} {*}${args}; +proc gm2_init_pim4 { paths args } { + gm2_init_pimx -fpim4 $paths {*}${args} } @@ -400,60 +406,70 @@ proc gm2_init_pim4 { {path ""} args } { # gm2_init_iso - set the default libraries to choose ISO and then PIM. # -proc gm2_init_iso { {path ""} args } { - global srcdir; - global gccpath; +proc gm2_init_iso { paths args } { + global srcdir + global gccpath - set gm2src ${srcdir}/../m2; + set gm2src ${srcdir}/../m2 - set isoIpath "${gccpath}/libgm2/libm2iso:${gm2src}/gm2-libs-iso"; - set pimIpath "${gccpath}/libgm2/libm2pim:${gm2src}/gm2-libs"; + set theIpath -I${gccpath}/libgm2/libm2iso + lappend theIpath -I${gm2src}/gm2-libs-iso - set isoLpath "${gccpath}/libgm2/libm2iso/.libs"; - set pimLpath "${gccpath}/libgm2/libm2pim/.libs"; + set theLpath -L${gccpath}/libgm2/libm2iso/.libs - set corIpath "${gccpath}/libgm2/libm2cor:${gm2src}/gm2-libs-coroutines"; - set corLpath "${gccpath}/libgm2/libm2cor/.libs"; + lappend theIpath -I${gccpath}/libgm2/libm2pim + lappend theIpath -I${gm2src}/gm2-libs-pim - set theIpath "-I${isoIpath} -I${corIpath} -I${pimIpath}"; - set theLpath "-L${isoLpath} -L${corLpath} -L${pimLpath}"; + # NOTE: + lappend theIpath -I${gm2src}/gm2-libs - if { $path != "" } then { - append theIpath " -I" - append theIpath ${path} + lappend theLpath -L${gccpath}/libgm2/libm2pim/.libs + + lappend theIpath -I${gccpath}/libgm2/libm2cor + lappend theIpath -I${gm2src}/gm2-libs-coroutines + + lappend theLpath -L${gccpath}/libgm2/libm2cor/.libs + + foreach p $paths { + lappend theIpath -I$p } gm2_link_lib "m2iso m2pim m2cor" - gm2_init {*}${theIpath} -fiso {*}${theLpath} {*}${args}; + lappend args -fno-libs=- + gm2_init {*}${theIpath} -fiso {*}${theLpath} {*}${args} } - # # gm2_init_ulm - set the default libraries to choose the ULM and PIM libraries. # -proc gm2_init_ulm { {path ""} args } { - global srcdir; - global gccpath; +proc gm2_init_ulm { paths args } { + global srcdir + global gccpath - set gm2src ${srcdir}/../m2; + set gm2src ${srcdir}/../m2 - set ulmIpath "${gccpath}/libgm2/libm2ulm:${gm2src}/ulm-lib-gm2/std:${gm2src}/ulm-lib-gm2/sys"; - set ulmLpath "${gccpath}/libgm2/libm2ulm/.libs"; + set theIpath -I${gccpath}/libgm2/libm2ulm + lappend theIpath -I${gm2src}/ulm-lib-gm2/std + lappend theIpath -I${gm2src}/ulm-lib-gm2/sys - set pimIpath "${gccpath}/libgm2/libm2pim:${gm2src}/gm2-libs"; - set pimLpath "${gccpath}/libgm2/libm2pim/.libs"; + set theLpath -L${gccpath}/libgm2/libm2ulm/.libs - set theIpath "-I${ulmIpath} -I${pimIpath}"; - set theLpath "-L${ulmLpath} -L${pimLpath}"; + lappend theIpath -I${gccpath}/libgm2/libm2pim + lappend theIpath -I${gm2src}/gm2-libs-pim - if { $path != "" } then { - append theIpath " -I" - append theIpath ${path} + # NOTE: + lappend theIpath -I${gm2src}/gm2-libs + + lappend theLpath -L${gccpath}/libgm2/libm2pim/.libs + + foreach p $paths { + lappend theIpath -I$p } gm2_link_lib "m2ulm m2pim" - gm2_init {*}${theIpath} -fpim {*}${theLpath} {*}${args}; + lappend args -fno-libs=- + gm2_init {*}${theIpath} -fpim {*}${theLpath} {*}${args} } @@ -462,35 +478,40 @@ proc gm2_init_ulm { {path ""} args } { # # -proc gm2_init_log { {path ""} args } { - global srcdir; - global gccpath; +proc gm2_init_log { paths args } { + global srcdir + global gccpath - set gm2src ${srcdir}/../m2; + set gm2src ${srcdir}/../m2 send_log "srcdir is $srcdir\n" send_log "gccpath is $gccpath\n" send_log "gm2src is $gm2src\n" - set logIpath "${gccpath}/libgm2/libm2log:${gm2src}/gm2-libs-pim"; - set logLpath "${gccpath}/libgm2/libm2log/.libs"; + # FIXME: this seems to interleave the library defs. + set theIpath -I${gccpath}/libgm2/libm2log + lappend theIpath -I${gm2src}/gm2-libs-pim + + set theLpath -L${gccpath}/libgm2/libm2log/.libs + + lappend theIpath -I${gccpath}/libgm2/libm2pim + lappend theIpath -I${gm2src}/gm2-libs - set pimIpath "${gccpath}/libgm2/libm2pim:${gm2src}/gm2-libs"; - set pimLpath "${gccpath}/libgm2/libm2pim/.libs"; + lappend theLpath -L${gccpath}/libgm2/libm2pim/.libs - set isoIpath "${gccpath}/libgm2/libm2iso:${gm2src}/gm2-libs-iso"; - set pimIpath "${gccpath}/libgm2/libm2pim:${gm2src}/gm2-libs"; + lappend theIpath -I${gccpath}/libgm2/libm2iso + lappend theIpath -I${gm2src}/gm2-libs-iso + # ??? lappend theIpath -I${gm2src}/gm2-libs - set theIpath "-I${logIpath} -I${pimIpath} -I${isoIpath}"; - set theLpath "-L${logLpath} -L${pimLpath}"; + lappend theLpath -L${gccpath}/libgm2/libm2iso/.libs - if { $path != "" } then { - append theIpath " -I" - append theIpath ${path} + foreach p $paths { + lappend theIpath -I$p } gm2_link_lib "m2log m2pim m2iso" - gm2_init {*}${theIpath} -fpim {*}${theLpath} {*}${args}; + lappend args -fno-libs=- + gm2_init {*}${theIpath} -fpim {*}${theLpath} {*}${args} } # @@ -498,39 +519,44 @@ proc gm2_init_log { {path ""} args } { # # -proc gm2_init_cor { {path ""} args } { - global srcdir; - global gccpath; - global gm2_link_libraries; +proc gm2_init_cor { paths args } { + global srcdir + global gccpath + global gm2_link_libraries - set gm2src ${srcdir}/../m2; + set gm2src ${srcdir}/../m2 send_log "srcdir is $srcdir\n" send_log "gccpath is $gccpath\n" send_log "gm2src is $gm2src\n" - set corIpath "${gccpath}/libgm2/libm2cor:${gm2src}/gm2-libs-coroutines"; - set corLpath "${gccpath}/libgm2/libm2cor/.libs"; + set theIpath -I${gccpath}/libgm2/libm2cor + lappend theIpath -I${gm2src}/gm2-libs-coroutines + + set theLpath -L${gccpath}/libgm2/libm2cor/.libs + + lappend theIpath -I${gccpath}/libgm2/libm2pim + lappend theIpath -I${gm2src}/gm2-libs-pim - set pimIpath "${gccpath}/libgm2/libm2pim:${gm2src}/gm2-libs"; - set pimLpath "${gccpath}/libgm2/libm2pim/.libs"; + lappend theLpath -L${gccpath}/libgm2/libm2pim/.libs - set isoIpath "${gccpath}/libgm2/libm2iso:${gm2src}/gm2-libs-iso"; - set isoLpath "${gccpath}/libgm2/libm2iso/.libs"; + lappend theIpath -I${gccpath}/libgm2/libm2log + lappend theIpath -I${gm2src}/gm2-libs - set logIpath "${gccpath}/libgm2/libm2log:${gm2src}/gm2-libs-pim"; - set logLpath "${gccpath}/libgm2/libm2log/.libs"; + lappend theLpath -L${gccpath}/libgm2/libm2log/.libs - set theIpath "-I${corIpath} -I${pimIpath} -I${logIpath} -I${isoIpath}"; - set theLpath "-L${corLpath} -L${pimLpath} -L${logLpath} -L${isoLpath}"; + lappend theIpath -I${gccpath}/libgm2/libm2iso + lappend theIpath -I${gm2src}/gm2-libs-iso - if { $path != "" } then { - append theIpath " -I" - append theIpath ${path} + lappend theLpath -L${gccpath}/libgm2/libm2iso/.libs + + foreach p $paths { + lappend theIpath -I$p } - gm2_link_lib "m2cor m2pim m2iso" - gm2_init {*}${theIpath} -fpim {*}${theLpath} {*}${args}; + gm2_link_lib "m2cor m2pim m2log m2iso" + append args " -fno-libs=- " + gm2_init {*}${theIpath} -fpim {*}${theLpath} {*}${args} } @@ -540,28 +566,27 @@ proc gm2_init_cor { {path ""} args } { # # -proc gm2_init_minx { dialect {path ""} args } { - global srcdir; - global gccpath; - set gm2src ${srcdir}/../m2; +proc gm2_init_minx { dialect paths args } { + global srcdir + global gccpath + set gm2src ${srcdir}/../m2 send_log "srcdir is $srcdir\n" send_log "gccpath is $gccpath\n" send_log "gm2src is $gm2src\n" - set theIpath " -I${gccpath}/libgm2/libm2min" - append theIpath " -I${gm2src}/gm2-libs-min" + set theIpath -I${gccpath}/libgm2/libm2min + lappend theIpath -I${gm2src}/gm2-libs-min - set theLpath " -L${gccpath}/libgm2/libm2min/.libs"; + set theLpath -L${gccpath}/libgm2/libm2min/.libs - if { $path != "" } then { - append theIpath " -I" - append theIpath ${path} + foreach p $paths { + lappend theIpath -I$p } gm2_link_lib "m2min" - append args " -fno-exceptions " - append args " -fno-libs=- " + lappend args -fno-exceptions + lappend args -fno-libs=- gm2_init {*}${theIpath} {*}${dialect} {*}${theLpath} {*}${args} } @@ -570,6 +595,6 @@ proc gm2_init_minx { dialect {path ""} args } { # and pim dialect. # -proc gm2_init_min { {path ""} args } { - gm2_init_minx -fpim {*}${path} {*}${args} +proc gm2_init_min { paths args } { + gm2_init_minx -fpim $paths {*}${args} } -- 2.37.1 (Apple Git-137.1)