https://gcc.gnu.org/g:25914b32fcf34912a108763a103154983f350651

commit r16-6101-g25914b32fcf34912a108763a103154983f350651
Author: Alexandre Oliva <[email protected]>
Date:   Sat Dec 13 04:11:29 2025 -0300

    [testsuite] allow relative line numbers in gnat.dg/
    
    The wrappers for dg-warning and dg-error that handle relative line
    numbers with process-message are only activated if the global
    variables gcc_warning_prefix and gcc_error_prefix, respectively, are
    defined.
    
    gnat.exp didn't set these variables, so we couldn't use relative line
    numbers.
    
    Set them to empty strings, for minimal disruption.
    
    
    for  gcc/testsuite/ChangeLog
    
            * lib/gnat.exp (gnat_init): Set gcc_warning_prefix and
            gcc_error_prefix.

Diff:
---
 gcc/testsuite/lib/gnat.exp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/testsuite/lib/gnat.exp b/gcc/testsuite/lib/gnat.exp
index d4d27a8cb41c..e30cf8e65292 100644
--- a/gcc/testsuite/lib/gnat.exp
+++ b/gcc/testsuite/lib/gnat.exp
@@ -88,6 +88,8 @@ proc gnat_init { args } {
     global GNAT_UNDER_TEST
     global TOOL_EXECUTABLE
     global gnat_target_current
+    global gcc_warning_prefix
+    global gcc_error_prefix
 
     set gnat_target_current ""
 
@@ -104,6 +106,11 @@ proc gnat_init { args } {
     if ![info exists tmpdir] then {
        set tmpdir /tmp
     }
+
+    # Setting these variables enables the use of relative line numbers
+    # in dg-error and dg-warning wrappers in gcc-dg.exp.
+    set gcc_warning_prefix ""
+    set gcc_error_prefix ""
 }
 
 proc gnat_target_compile { source dest type options } {

Reply via email to