From 7e322d576eb6a87607215196bec62d3348e65b0e Mon Sep 17 00:00:00 2001
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Fri, 31 May 2024 09:29:38 +0200
Subject: [PATCH] testsuite: Adjust several dg-additional-files-options calls
 [PR115294]

A recent patch

commit bdc264a16e327c63d133131a695a202fbbc0a6a0
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu May 30 02:06:48 2024 -0300

    [testsuite] conditionalize dg-additional-sources on target and type

added two additional args to dg-additional-files-options.
Unfortunately, this completely broke several testsuites like

ERROR: tcl error sourcing /vol/gcc/src/hg/master/local/libatomic/testsuite/../../gcc/testsuite/lib/gcc-dg.exp.
wrong # args: should be "dg-additional-files-options options source dest type"

since the patch forgot to adjust some of the callers.

This patch fixes that.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

2024-05-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libatomic:
	PR testsuite/115294
	* testsuite/lib/libatomic.exp (libatomic_target_compile): Pass new
	dg-additional-files-options args.

	libgomp:
	PR testsuite/115294
	* testsuite/lib/libgomp.exp (libgomp_target_compile): Pass new
	dg-additional-files-options args.

	libitm:
	PR testsuite/115294
	* testsuite/lib/libitm.exp (libitm_target_compile): Pass new
	dg-additional-files-options args.

	libphobos:
	PR testsuite/115294
	* testsuite/lib/libphobos.exp (libphobos_target_compile): Pass new
	dg-additional-files-options args.

	libvtv:
	PR testsuite/115294
	* testsuite/lib/libvtv.exp (libvtv_target_compile): Pass new
	dg-additional-files-options args.
---
 libatomic/testsuite/lib/libatomic.exp | 2 +-
 libgomp/testsuite/lib/libgomp.exp     | 2 +-
 libitm/testsuite/lib/libitm.exp       | 2 +-
 libphobos/testsuite/lib/libphobos.exp | 2 +-
 libvtv/testsuite/lib/libvtv.exp       | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp
index 432a67e12e9f..ed6ba806732f 100644
--- a/libatomic/testsuite/lib/libatomic.exp
+++ b/libatomic/testsuite/lib/libatomic.exp
@@ -214,7 +214,7 @@ proc libatomic_target_compile { source dest type options } {
 	set options [concat "$ALWAYS_CFLAGS" $options]
     }
 
-    set options [dg-additional-files-options $options $source]
+    set options [dg-additional-files-options $options $source $dest $type]
 
     set result [target_compile $source $dest $type $options]
 
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index cab926a798bf..7c1092629168 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -296,7 +296,7 @@ proc libgomp_target_compile { source dest type options } {
 	set options [concat "$ALWAYS_CFLAGS" $options]
     }
 
-    set options [dg-additional-files-options $options $source]
+    set options [dg-additional-files-options $options $source $dest $type]
 
     set result [target_compile $source $dest $type $options]
 
diff --git a/libitm/testsuite/lib/libitm.exp b/libitm/testsuite/lib/libitm.exp
index 61bbfa0c9230..3e60797c3e31 100644
--- a/libitm/testsuite/lib/libitm.exp
+++ b/libitm/testsuite/lib/libitm.exp
@@ -217,7 +217,7 @@ proc libitm_target_compile { source dest type options } {
 	set options [concat "$ALWAYS_CFLAGS" $options]
     }
 
-    set options [dg-additional-files-options $options $source]
+    set options [dg-additional-files-options $options $source $dest $type]
 
     set result [target_compile $source $dest $type $options]
 
diff --git a/libphobos/testsuite/lib/libphobos.exp b/libphobos/testsuite/lib/libphobos.exp
index d4aa433ddc14..a4a2fe3d56d4 100644
--- a/libphobos/testsuite/lib/libphobos.exp
+++ b/libphobos/testsuite/lib/libphobos.exp
@@ -281,7 +281,7 @@ proc libphobos_target_compile { source dest type options } {
     lappend options "compiler=$gdc_final"
     lappend options "timeout=[timeout_value]"
 
-    set options [dg-additional-files-options $options $source]
+    set options [dg-additional-files-options $options $source $dest $type]
     set comp_output [target_compile $source $dest $type $options]
 
     return $comp_output
diff --git a/libvtv/testsuite/lib/libvtv.exp b/libvtv/testsuite/lib/libvtv.exp
index 4b71c9ce7bcf..bfd03d7d2580 100644
--- a/libvtv/testsuite/lib/libvtv.exp
+++ b/libvtv/testsuite/lib/libvtv.exp
@@ -212,7 +212,7 @@ proc libvtv_target_compile { source dest type options } {
 	set options [concat "$ALWAYS_CFLAGS" $options]
     }
 
-    set options [dg-additional-files-options $options $source]
+    set options [dg-additional-files-options $options $source $dest $type]
 
     set result [target_compile $source $dest $type $options]
 
-- 
GitLab