Skip to content

Commit f8cb07a

Browse files
committed
modula-2, testsuite: Make libs and interfaces consistent.
In some case the libraries list was being set before gm2_init_xxx was called. In some cases it was omitted - this could lead to a difference between the link libs and the interfaces (the effect of this would be dependent on the order in which the .exps were run, which makes it also depend on the -j and the system). To avoid a mismatch between the module include paths and the added libs we now make sure that they are both added in the gm_init_xxxx functions (if finer control over granularity is needed, then we should as a TODO add a generic gm_init_xxx that takes a library list and ensures that the imports and libs are matched in the same order). Also we cannot use a default variable in tcl if the source for that variable could be absent, but something else follows, there is no way to put an empty placeholder in. Signed-off-by: Iain Sandoe <[email protected]> gcc/testsuite/ChangeLog: * gm2/complex/run/pass/complex-run-pass.exp: Remove gm2_link_lib. * gm2/iso/run/pass/iso-run-pass.exp: Likewise. * gm2/link/externalscaffold/pass/link-externalscaffold-pass.exp: * gm2/pimlib/logitech/run/pass/pimlib-logitech-run-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/pim/run/pass/hello/projects-pim-run-pass-hello.exp: Likewise. * gm2/sets/run/pass/sets-run-pass.exp: Likewise. * gm2/switches/none/run/pass/gm2-none.exp: Likewise. * gm2/switches/pic/run/pass/switches-pic-run-pass.exp: Likewise. * gm2/projects/pim/run/pass/random/projects-pim-run-pass-random.exp: Likewise, and also ensure that the -g option is appended to avoid it being taken as a path. * lib/gm2.exp: Ensure for each gm2_init_xxxx function that the set of libraries added matches the set of -I and -L options.
1 parent 5115508 commit f8cb07a

File tree

13 files changed

+26
-37
lines changed

13 files changed

+26
-37
lines changed

gcc/testsuite/gm2/complex/run/pass/complex-run-pass.exp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ load_lib gm2-torture.exp
2727

2828
set gm2src ${srcdir}/../gm2
2929

30-
gm2_link_lib "m2iso m2pim"
3130
gm2_init_iso "${srcdir}/gm2/complex/run/pass"
3231

3332

gcc/testsuite/gm2/iso/run/pass/iso-run-pass.exp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ if $tracelevel then {
2424
# load support procs
2525
load_lib gm2-torture.exp
2626

27-
gm2_link_lib "m2iso m2pim"
2827
gm2_init_iso "${srcdir}/gm2/iso/run/pass" -fsoft-check-all
2928
gm2_link_obj fileio.o
3029

gcc/testsuite/gm2/link/externalscaffold/pass/link-externalscaffold-pass.exp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ if $tracelevel then {
2525
# load support procs
2626
load_lib gm2-torture.exp
2727

28-
gm2_link_lib "m2pim"
2928
gm2_init_pim "${srcdir}/gm2/pim/pass" -fscaffold-main -fno-scaffold-dynamic
3029
gm2_link_obj scaffold.o
3130
set output [target_compile $srcdir/$subdir/scaffold.c scaffold.o object "-g"]

gcc/testsuite/gm2/pimlib/logitech/run/pass/pimlib-logitech-run-pass.exp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ load_lib gm2-torture.exp
2727

2828
set gm2src ${srcdir}/../m2
2929

30-
gm2_link_lib "m2log m2pim m2iso"
3130
gm2_init_log
3231

33-
3432
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
3533
# If we're only testing specific files and this isn't one of them, skip it.
3634
if ![runtest_file_p $runtests $testcase] then {

gcc/testsuite/gm2/pimlib/run/pass/pimlib-run-pass.exp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ load_lib gm2-torture.exp
2727

2828
set gm2src ${srcdir}/../m2
2929

30-
gm2_link_lib "m2pim m2log m2iso"
3130
gm2_init_log
3231

33-
3432
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
3533
# If we're only testing specific files and this isn't one of them, skip it.
3634
if ![runtest_file_p $runtests $testcase] then {

gcc/testsuite/gm2/projects/iso/run/pass/halma/projects-iso-run-pass-halma.exp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ load_lib gm2-torture.exp
2727

2828
set gm2src ${srcdir}/../m2
2929

30-
gm2_link_lib "m2iso m2pim"
3130
gm2_init_iso
3231

3332
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {

gcc/testsuite/gm2/projects/iso/run/pass/hello/projects-iso-run-pass-hello.exp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ load_lib gm2-torture.exp
2727

2828
set gm2src ${srcdir}/../m2
2929

30-
gm2_link_lib "m2iso m2pim"
3130
gm2_init_iso
3231

3332
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {

gcc/testsuite/gm2/projects/pim/run/pass/hello/projects-pim-run-pass-hello.exp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ load_lib gm2-torture.exp
2727

2828
set gm2src ${srcdir}/../m2
2929

30-
gm2_link_lib "m2pim m2log m2iso"
3130
gm2_init_pim
3231

3332
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {

gcc/testsuite/gm2/projects/pim/run/pass/random/projects-pim-run-pass-random.exp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,26 @@ if $tracelevel then {
2525
# load support procs
2626
load_lib gm2-torture.exp
2727

28-
set gm2src ${srcdir}/../m2
29-
30-
gm2_link_lib "m2pim m2log m2iso"
31-
gm2_init_pim "-g -I$srcdir/$subdir"
28+
gm2_init_pim "$srcdir/$subdir" -g
3229
gm2_link_obj "WriteMap.o AdvMap.o BoxMap.o Chance.o Geometry.o MakeBoxes.o MapOptions.o Options.o RoomMap.o StoreCoords.o"
3330

31+
# If we want these to be re-built for each torture option we need some different
32+
# logic.
33+
gm2_target_compile $srcdir/$subdir/AdvMap.mod AdvMap.o object "-g -I$srcdir/$subdir/"
34+
gm2_target_compile $srcdir/$subdir/BoxMap.mod BoxMap.o object "-g -I$srcdir/$subdir/"
35+
gm2_target_compile $srcdir/$subdir/Chance.mod Chance.o object "-g -I$srcdir/$subdir/"
36+
gm2_target_compile $srcdir/$subdir/Geometry.mod Geometry.o object "-g -I$srcdir/$subdir/"
37+
gm2_target_compile $srcdir/$subdir/MakeBoxes.mod MakeBoxes.o object "-g -I$srcdir/$subdir/"
38+
gm2_target_compile $srcdir/$subdir/MapOptions.mod MapOptions.o object "-g -I$srcdir/$subdir/"
39+
gm2_target_compile $srcdir/$subdir/Options.mod Options.o object "-g -I$srcdir/$subdir/"
40+
gm2_target_compile $srcdir/$subdir/RoomMap.mod RoomMap.o object "-g -I$srcdir/$subdir/"
41+
gm2_target_compile $srcdir/$subdir/StoreCoords.mod StoreCoords.o object "-g -I$srcdir/$subdir/"
42+
gm2_target_compile $srcdir/$subdir/WriteMap.mod WriteMap.o object "-g -I$srcdir/$subdir/"
43+
3444
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/Map.mod]] {
3545
# If we're only testing specific files and this isn't one of them, skip it.
3646
if ![runtest_file_p $runtests $testcase] then {
3747
continue
3848
}
39-
40-
gm2_target_compile $srcdir/$subdir/AdvMap.mod AdvMap.o object "-g -I$srcdir/$subdir/"
41-
gm2_target_compile $srcdir/$subdir/BoxMap.mod BoxMap.o object "-g -I$srcdir/$subdir/"
42-
gm2_target_compile $srcdir/$subdir/Chance.mod Chance.o object "-g -I$srcdir/$subdir/"
43-
gm2_target_compile $srcdir/$subdir/Geometry.mod Geometry.o object "-g -I$srcdir/$subdir/"
44-
gm2_target_compile $srcdir/$subdir/MakeBoxes.mod MakeBoxes.o object "-g -I$srcdir/$subdir/"
45-
gm2_target_compile $srcdir/$subdir/MapOptions.mod MapOptions.o object "-g -I$srcdir/$subdir/"
46-
gm2_target_compile $srcdir/$subdir/Options.mod Options.o object "-g -I$srcdir/$subdir/"
47-
gm2_target_compile $srcdir/$subdir/RoomMap.mod RoomMap.o object "-g -I$srcdir/$subdir/"
48-
gm2_target_compile $srcdir/$subdir/StoreCoords.mod StoreCoords.o object "-g -I$srcdir/$subdir/"
49-
gm2_target_compile $srcdir/$subdir/WriteMap.mod WriteMap.o object "-g -I$srcdir/$subdir/"
5049
gm2-torture-execute $testcase "" "pass"
5150
}

gcc/testsuite/gm2/sets/run/pass/sets-run-pass.exp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ load_lib gm2-torture.exp
2727

2828
set gm2src ${srcdir}/../m2
2929

30-
gm2_link_lib "m2iso m2pim"
3130
gm2_init_iso "${srcdir}/gm2/sets/run/pass/"
3231

3332
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {

0 commit comments

Comments
 (0)