]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[testsuite] allow relative line numbers in gnat.dg/
authorAlexandre Oliva <oliva@adacore.com>
Sat, 13 Dec 2025 07:11:29 +0000 (04:11 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Sat, 13 Dec 2025 07:30:48 +0000 (04:30 -0300)
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.

gcc/testsuite/lib/gnat.exp

index d4d27a8cb41cf8537893e206d7ef0fda1b9d8624..e30cf8e65292756d7adf6ea750440bbae0462663 100644 (file)
@@ -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 } {