From: Thomas Schwinge <thomas@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>,
Richard Henderson <rth@redhat.com>, <gcc-patches@gcc.gnu.org>
Cc: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>,
Mike Stump <mikestump@comcast.net>,
Janis Johnson <janisjo@codesourcery.com>
Subject: libgomp testsuite: (not) using a specific driver for C++, Fortran?
Date: Wed, 15 Oct 2014 15:52:00 -0000 [thread overview]
Message-ID: <87h9z5wd1z.fsf@schwinge.name> (raw)
[-- Attachment #1: Type: text/plain, Size: 4575 bytes --]
Hi!
No matter whether it's C, C++, or Fortran source code, the libgomp
testsuite always uses (for build-tree testing) gcc/xgcc, or (for
installed testing) GCC_UNDER_TEST. It doesn't make use of
GXX_UNDER_TEST, GFORTRAN_UNDER_TEST. To support the latter two
languages' needs, some -l[...] flags are then added via lang_link_flags.
For example, for Fortran this is -lgfortran. This is, however, not what
would happen if using the gfortran driver to build (which is what a user
would be doing -- which we should replicate as much as possible at least
for installed testing): the gfortran driver also adds -lquadmath, if
applicable.
Now, I wonder why to re-invent all that in the libgomp testsuite, if the
respective driver already has that knowledge, via spec files, for
example? (Also, the regular GCC compiler tests, gcc/testsuite/, are
doing the right thing.) Why is libgomp testsuite implemented this way --
just a legacy of the past, or is there a need for that (that I'm not
seeing)?
Maybe the question also is: why isn't the libgomp testsuite using more of
the infrastructure for specific languages, that is already implemented in
gcc/testsuite/lib/? (That is, why does libgomp have to use
libgomp_target_compile, instead of [language]_target_compile, for
example.)
And maybe that problem also applied to additional target libraries'
testsuites; I have not yet looked.
Anyway, here is a prototype patch to describe how I began to address this
for the issue I stumbled upon, which is that the linker complained:
Executing on host: x86_64-none-linux-gnu-gcc [...]/libgomp/testsuite/libgomp.fortran/aligned1.f03 [...] -fopenmp -O0 -fopenmp -fcray-pointer -lgfortran -lm -o ./aligned1.exe (timeout = 300)
[...]/ld: warning: libquadmath.so.0, needed by [...]/libgfortran.so, not found (try using -rpath or -rpath-link)
[...]/libgfortran.so: undefined reference to `logq@QUADMATH_1.0'
[...]
(That goes away if I add -lquadmath to the command line, but that's not
the point I'm making here.)
Am I on the right track with the following?
--- libgomp/testsuite/lib/libgomp.exp
+++ libgomp/testsuite/lib/libgomp.exp
@@ -210,7 +210,6 @@ proc libgomp_target_compile { source dest type options } {
lappend options "additional_flags=[libio_include_flags]"
lappend options "timeout=[timeout_value]"
- lappend options "compiler=$GCC_UNDER_TEST"
set options [concat $libgomp_compile_options $options]
--- libgomp/testsuite/libgomp.c++/c++.exp
+++ libgomp/testsuite/libgomp.c++/c++.exp
@@ -4,6 +4,7 @@ load_gcc_lib gcc-dg.exp
global shlib_ext
set shlib_ext [get_shlib_extension]
+#TODO
set lang_link_flags "-lstdc++"
set lang_test_file_found 0
set lang_library_path "../libstdc++-v3/src/.libs"
@@ -41,6 +42,11 @@ if { $blddir != "" } {
}
if { $lang_test_file_found } {
+ if ![info exists GXX_UNDER_TEST] then {
+ set GXX_UNDER_TEST $GCC_UNDER_TEST
+ }
+ lappend libgomp_compile_options "compiler=$GXX_UNDER_TEST"
+
# Gather a list of all tests.
set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
--- libgomp/testsuite/libgomp.c/c.exp
+++ libgomp/testsuite/libgomp.c/c.exp
@@ -23,6 +23,8 @@ dg-init
# Turn on OpenMP.
lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
+lappend libgomp_compile_options "compiler=$GCC_UNDER_TEST"
+
# Gather a list of all tests.
set tests [lsort [find $srcdir/$subdir *.c]]
--- libgomp/testsuite/libgomp.fortran/fortran.exp
+++ libgomp/testsuite/libgomp.fortran/fortran.exp
@@ -7,6 +7,7 @@ global ALWAYS_CFLAGS
set shlib_ext [get_shlib_extension]
set lang_library_path "../libgfortran/.libs"
+#TODO
set lang_link_flags "-lgfortran"
if [info exists lang_include_flags] then {
unset lang_include_flags
@@ -44,6 +45,11 @@ if { $blddir != "" } {
}
if { $lang_test_file_found } {
+ if ![info exists GFORTRAN_UNDER_TEST] then {
+ set GFORTRAN_UNDER_TEST $GCC_UNDER_TEST
+ }
+ lappend libgomp_compile_options "compiler=$GFORTRAN_UNDER_TEST"
+
# Gather a list of all tests.
set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
--- libgomp/testsuite/libgomp.graphite/graphite.exp
+++ libgomp/testsuite/libgomp.graphite/graphite.exp
@@ -48,6 +48,8 @@ dg-init
# Turn on OpenMP.
lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
+lappend libgomp_compile_options "compiler=$GCC_UNDER_TEST"
+
# Gather a list of all tests.
set tests [lsort [find $srcdir/$subdir *.c]]
Grüße,
Thomas
[-- Attachment #2: Type: application/pgp-signature, Size: 472 bytes --]
next reply other threads:[~2014-10-15 15:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-15 15:52 Thomas Schwinge [this message]
2014-11-04 12:14 ` Thomas Schwinge
2014-11-04 18:32 ` Mike Stump
2023-05-09 12:36 ` libgomp C++ testsuite: Don't compute 'blddir' twice (was: libgomp testsuite: (not) using a specific driver for C++, Fortran?) Thomas Schwinge
2023-05-09 12:39 ` libgomp testsuite: Only use 'blddir' if set (was: libgomp C++ testsuite: Don't compute 'blddir' twice (was: libgomp testsuite: (not) using a specific driver for C++, Fortran?)) Thomas Schwinge
2023-05-09 12:41 ` libgomp testsuite: Use 'lang_test_file_found' instead of 'lang_test_file' (was: libgomp testsuite: Only use 'blddir' if set (was: libgomp C++ testsuite: Don't compute 'blddir' twice (was: libgomp testsuite: (not) using a specific driver for C++, Fortran?))) Thomas Schwinge
2023-05-09 12:54 ` libgomp testsuite: Localize 'lang_[...]' etc. (was: libgomp testsuite: (not) using a specific driver for C++, Fortran?) Thomas Schwinge
2023-05-09 12:59 ` libgomp C++, Fortran testsuites: Resolve 'lang_test_file_found' first (was: libgomp testsuite: Localize 'lang_[...]' etc. (was: libgomp testsuite: (not) using a specific driver for C++, Fortran?)) Thomas Schwinge
2023-05-09 13:05 ` libgomp testsuite: Get rid of 'lang_test_file_found' (was: libgomp C++, Fortran testsuites: Resolve 'lang_test_file_found' first (was: libgomp testsuite: Localize 'lang_[...]' etc. (was: libgomp testsuite: (not) using a specific driver for C++, Fortran?))) Thomas Schwinge
2023-05-12 7:26 ` libgomp testsuite: Generalize 'lang_library_path' into a list of 'lang_library_paths' (was: libgomp testsuite: (not) using a specific driver for C++, Fortran?) Thomas Schwinge
2023-05-12 8:27 ` libgomp testsuite: Have each '*.exp' file specify the compiler to use [PR91884] " Thomas Schwinge
2023-05-12 8:33 ` libgomp testsuite: As appropriate, use the 'gcc', 'g++', 'gfortran' driver [PR91884] (was: libgomp testsuite: Have each '*.exp' file specify the compiler to use [PR91884] (was: libgomp testsuite: (not) using a specific driver for C++, Fortran?)) Thomas Schwinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h9z5wd1z.fsf@schwinge.name \
--to=thomas@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=janisjo@codesourcery.com \
--cc=mikestump@comcast.net \
--cc=ro@CeBiTec.Uni-Bielefeld.DE \
--cc=rth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).