From fe6e61fb236e1ac764a7f044ae80ddf458e981a6 Mon Sep 17 00:00:00 2001
From: Gaius Mulley <gaiusmod2@gmail.com>
Date: Fri, 24 Mar 2023 12:16:44 +0000
Subject: [PATCH] modula2: Enable iso-extended-opaque-run-pass.exp to build
 library tests

This patch fixes the tcl test script iso-extended-opaque-run-pass.exp so
that the test library modules are built and included with the link command.

gcc/testsuite/ChangeLog:

	* gm2/projects/iso/small/run/pass/iso-extended-opaque-run-pass.exp:
	Compile object for stressset.mod and testlib.mod.  Add test so
	that we only link these	objects with test application objects.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
---
 .../iso/small/run/pass/iso-extended-opaque-run-pass.exp     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gm2/projects/iso/small/run/pass/iso-extended-opaque-run-pass.exp b/gcc/testsuite/gm2/projects/iso/small/run/pass/iso-extended-opaque-run-pass.exp
index bb9f19ef217f..4669290befbd 100755
--- a/gcc/testsuite/gm2/projects/iso/small/run/pass/iso-extended-opaque-run-pass.exp
+++ b/gcc/testsuite/gm2/projects/iso/small/run/pass/iso-extended-opaque-run-pass.exp
@@ -25,7 +25,7 @@ if $tracelevel then {
 load_lib gm2-torture.exp
 
 gm2_init_iso "${srcdir}/gm2/projects/iso/small/run/pass"
-gm2_link_obj testlib.o
+gm2_link_obj "testlib.o stressset.o"
 
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
     # If we're only testing specific files and this isn't one of them, skip it.
@@ -33,8 +33,10 @@ foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
 	continue
     }
 
-    if { $testcase != "$srcdir/$subdir/testlib.mod" } {
+    if { $testcase != "$srcdir/$subdir/testlib.mod" &&
+	 $testcase != "$srcdir/$subdir/stressset.mod" } then {
         gm2_target_compile $srcdir/$subdir/testlib.mod testlib.o object "-g"
+        gm2_target_compile $srcdir/$subdir/stressset.mod stressset.o object "-g"
 	gm2-torture-execute $testcase "" "pass"
     }
 }
-- 
GitLab