Hello-

This patch helps tools like contrib/compare_tests work out of the box for the
libitm testsuite. Without this change, compare_tests complains if the test
runs being compared were in different build directories.

I just moved the -B argument from one place to another, so the command line
executed by runtest is more or less the same as before. FWIW however, I was
not able to confirm it entirely because on every platform I tried
(x86-64-linux, sparc, aarch64, x86_64-apple-darwin24.1.0), the tests also
work fine with the -B argument omitted entirely. I was not able to figure
out under what circumstances the -B is needed, given that -L is already
passed with the same location. I see that it was added in r14-4827, which
was about fixing the tests on newer versions of darwin.

Thanks!

-Lewis

-- >8 --

The libitm c++ tests pass an extra -B<dir> option argument to all dg-runtest
invocations, where <dir> depends on the absolute path to the build
directory, to help find libstdc++. This argument ends up as part of each
test name in the test results summary, so an extra filtering step is often
required to avoid spurious complaints from test result comparison tools like
contrib/compare_tests, since it is common to compare test results from two
different build directories.

Fixed by applying the -B option in libitm_target_compile directly, so that
dg-runtest doesn't see it and add it to the test name.

libitm/ChangeLog:

        * testsuite/libitm.c++/c++.exp: Move -B argument for libstdc++ to...
        * testsuite/lib/libitm.exp (libitm_target_compile): ...here.
---
 libitm/testsuite/lib/libitm.exp     | 1 +
 libitm/testsuite/libitm.c++/c++.exp | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libitm/testsuite/lib/libitm.exp b/libitm/testsuite/lib/libitm.exp
index ac390d6d0dd..41acbfca58e 100644
--- a/libitm/testsuite/lib/libitm.exp
+++ b/libitm/testsuite/lib/libitm.exp
@@ -199,6 +199,7 @@ proc libitm_target_compile { source dest type options } {
     if { [info exists lang_test_file] } {
        if { $blddir != "" } {
            lappend options "ldflags=-L${blddir}/${lang_library_path}"
+           lappend options "additional_flags=-B${blddir}/${lang_library_path}"
        }
        lappend options "ldflags=${lang_link_flags}"
     }
diff --git a/libitm/testsuite/libitm.c++/c++.exp 
b/libitm/testsuite/libitm.c++/c++.exp
index ab278f2cb33..906f51aac66 100644
--- a/libitm/testsuite/libitm.c++/c++.exp
+++ b/libitm/testsuite/libitm.c++/c++.exp
@@ -56,10 +56,8 @@ if { $lang_test_file_found } {
     # Gather a list of all tests.
     set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
 
-    set stdcxxadder ""
     if { $blddir != "" } {
        set ld_library_path 
"$always_ld_library_path:${blddir}/${lang_library_path}"
-       set stdcxxadder "-B ${blddir}/${lang_library_path}"
     } else {
        set ld_library_path "$always_ld_library_path"
     }
@@ -74,7 +72,7 @@ if { $lang_test_file_found } {
     }
 
     # Main loop.
-    dg-runtest $tests $stdcxxadder $libstdcxx_includes
+    dg-runtest $tests "" $libstdcxx_includes
 }
 
 # All done.

Reply via email to