aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2024-01-26 15:23:19 +0000
committerIain Sandoe <iain@sandoe.co.uk>2024-02-02 15:46:08 +0000
commitae061a1757b2c76ddf4cc2c84b433fe1cd6dd7f7 (patch)
treee04f6d53106beb0195d224c2614614d5577b0b38 /gcc/testsuite/gfortran.dg
parenta6afa0d06b0559b22be829ff197495d5c8653b96 (diff)
downloadgcc-ae061a1757b2c76ddf4cc2c84b433fe1cd6dd7f7.zip
gcc-ae061a1757b2c76ddf4cc2c84b433fe1cd6dd7f7.tar.gz
gcc-ae061a1757b2c76ddf4cc2c84b433fe1cd6dd7f7.tar.bz2
testsuite, ubsan: Add libstdc++ deps where required.
We use the ubsan tests from both C, C++, D and Fortran. thee sanitizer libraries link to libstdc++. When we are using the C/gdc/gfortran driver, and the target might require a path to the libstdc++ (e.g. for handing -static-xxxx or for embedded runpaths), we need to add a suitable option (or we get fails at execution time because of the missing paths). Conversely, we do not want to add multiple instances of these paths (since that leads to failures on tools that report warnings for duplicate runpaths). This patch modifies the _init function to allow a sigle parameter that determines whether the *asan_init should add a path for libstdc++ (yes for C driver, no for C++ driver). gcc/testsuite/ChangeLog: * g++.dg/ubsan/ubsan.exp:Add a parameter to init to say that we expect the C++ driver to provide paths for libstdc++. * gcc.dg/ubsan/ubsan.exp: Add a parameter to init to say that we need a path added for libstdc++. * gdc.dg/ubsan/ubsan.exp: Likewise. * gfortran.dg/ubsan/ubsan.exp: Likewise. * lib/ubsan-dg.exp: Handle a single parameter to init that requests addition of a path to libstdc++ to link flags.
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/ubsan/ubsan.exp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/testsuite/gfortran.dg/ubsan/ubsan.exp b/gcc/testsuite/gfortran.dg/ubsan/ubsan.exp
index 0c61153..b236078 100644
--- a/gcc/testsuite/gfortran.dg/ubsan/ubsan.exp
+++ b/gcc/testsuite/gfortran.dg/ubsan/ubsan.exp
@@ -22,10 +22,10 @@
load_lib gfortran-dg.exp
load_lib ubsan-dg.exp
-
# Initialize `dg'.
dg-init
-ubsan_init
+# libubsan uses libstdc++ so make sure we provide paths for it.
+ubsan_init 1
# Main loop.
if [check_effective_target_fsanitize_undefined] {